From 846b9ba82e7ef1672d07c11424be833244af6903 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sun, 29 Dec 2019 16:05:14 +0000 Subject: [PATCH 001/102] start implementation of HTTP signature --- .../python-experimental/api_client.mustache | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 25ca4b5043ff..b8e8d2d97129 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -10,6 +10,10 @@ import os # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import quote +from Crypto.PublicKey import RSA +from Crypto.Signature import PKCS1_v1_5 +from Crypto.Hash import SHA256 +from base64 import b64encode {{#tornado}} import tornado.gen {{/tornado}} @@ -542,3 +546,116 @@ class ApiClient(object): raise ApiValueError( 'Authentication token must be in `query` or `header`' ) + + def prepare_auth_header(self, resource_path, method, body, query_params): + """ + Create a message signature for the HTTP request and add the signed headers. + + :param resource_path : resource path which is the api being called upon. + :param method: request type + :param body: body passed in the http request. + :param query_params: query parameters used by the API + :return: instance of digest object + """ + if body is None: + body = '' + else: + body = json.dumps(body) + + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + + request_target = method + " " + target_path + resource_path + + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query + + from email.utils import formatdate + cdate=formatdate(timeval=None, localtime=False, usegmt=True) + + request_body = body.encode() + body_digest = self.get_sha256_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + + headers = {'Content-Type': 'application/json', 'Date' : cdate, 'Host' : target_host, 'Digest' : "SHA-256=" + b64_body_digest.decode('ascii')} + + string_to_sign = self.prepare_str_to_sign(request_target, headers) + + digest = self.get_sha256_digest(string_to_sign.encode()) + + b64_signed_msg = self.get_rsasig_b64encode(self.private_key_file, digest) + + auth_header = self.get_auth_header(headers, b64_signed_msg) + + self.set_default_header('Date', '{0}'.format(cdate)) + self.set_default_header('Host', '{0}'.format(target_host)) + self.set_default_header('Digest', 'SHA-256={0}'.format(b64_body_digest.decode('ascii'))) + self.set_default_header('Authorization', '{0}'.format(auth_header)) + + def get_sha256_digest(self, data): + """ + :param data: Data set by User + :return: instance of digest object + """ + digest = SHA256.new() + digest.update(data) + + return digest + + def get_rsasig_b64encode(self, private_key_path, digest): + """ + :param private_key_path : abs path to private key .pem file. + :param digest: digest + :return: instance of digest object + """ + + key = open(private_key_path, "r").read() + rsakey = RSA.importKey(key) + signer = PKCS1_v1_5.new(rsakey) + sign = signer.sign(digest) + + return b64encode(sign) + + def prepare_str_to_sign(self, req_tgt, hdrs): + """ + :param req_tgt : Request Target as stored in http header. + :param hdrs: HTTP Headers to be signed. + :return: instance of digest object + """ + ss = "" + ss = ss + "(request-target): " + req_tgt.lower() + "\n" + + length = len(hdrs.items()) + + i = 0 + for key, value in hdrs.items(): + ss = ss + key.lower() + ": " + value + if i < length-1: + ss = ss + "\n" + i += 1 + + return ss + + def get_auth_header(self, hdrs, signed_msg): + """ + This method prepares the Auth header string + + :param hdrs : HTTP Headers + :param signed_msg: Signed Digest + :return: instance of digest object + """ + + auth_str = "" + auth_str = auth_str + "Signature" + + auth_str = auth_str + " " + "keyId=\"" + self.api_key_id + "\"," + "algorithm=\"" + self.digest_algorithm + "\"," + "headers=\"(request-target)" + + for key, _ in hdrs.items(): + auth_str = auth_str + " " + key.lower() + auth_str = auth_str + "\"" + + auth_str = auth_str + "," + "signature=\"" + signed_msg.decode('ascii') + "\"" + + return auth_str + From 64733bd797fd627c39fb28df9db4e54418e31833 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 2 Jan 2020 11:28:50 -0800 Subject: [PATCH 002/102] add api key parameters for http message signature --- .../main/resources/python/configuration.mustache | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 6e02b238da1a..9ef4fb76ab00 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -30,7 +30,8 @@ class Configuration(object): def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -59,6 +60,18 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """ The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """ The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. Supported values are rsa-sha256, rsa-sha512, hs2019. + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests. + """ {{#hasOAuthMethods}} self.access_token = "" """access token for OAuth/Bearer From b151f2006ecbe621697596afba486238f3e81188 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 6 Jan 2020 04:16:40 +0000 Subject: [PATCH 003/102] HTTP signature authentication --- bin/openapi3/python-experimental-petstore.sh | 32 + .../openapitools/codegen/CodegenSecurity.java | 5 +- .../openapitools/codegen/DefaultCodegen.java | 5 + .../codegen/DefaultGenerator.java | 13 + .../resources/python/configuration.mustache | 62 +- .../python-experimental/api_client.mustache | 140 +- .../python/python-experimental/setup.mustache | 4 + ...ith-fake-endpoints-models-for-testing.yaml | 3 + .../python/petstore_api/configuration.py | 21 +- .../petstore/python-experimental/.gitignore | 64 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../petstore/python-experimental/.travis.yml | 14 + .../petstore/python-experimental/README.md | 216 ++ .../docs/AdditionalPropertiesClass.md | 11 + .../python-experimental/docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 63 + .../python-experimental/docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../python-experimental/docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../petstore/python-experimental/docs/Cat.md | 12 + .../python-experimental/docs/CatAllOf.md | 10 + .../python-experimental/docs/Category.md | 11 + .../python-experimental/docs/ClassModel.md | 11 + .../python-experimental/docs/Client.md | 10 + .../python-experimental/docs/DefaultApi.md | 56 + .../petstore/python-experimental/docs/Dog.md | 12 + .../python-experimental/docs/DogAllOf.md | 10 + .../python-experimental/docs/EnumArrays.md | 11 + .../python-experimental/docs/EnumClass.md | 10 + .../python-experimental/docs/EnumTest.md | 17 + .../python-experimental/docs/FakeApi.md | 828 +++++++ .../docs/FakeClassnameTags123Api.md | 71 + .../petstore/python-experimental/docs/File.md | 11 + .../docs/FileSchemaTestClass.md | 11 + .../petstore/python-experimental/docs/Foo.md | 10 + .../python-experimental/docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 11 + .../python-experimental/docs/InlineObject.md | 11 + .../python-experimental/docs/InlineObject1.md | 11 + .../python-experimental/docs/InlineObject2.md | 11 + .../python-experimental/docs/InlineObject3.md | 23 + .../python-experimental/docs/InlineObject4.md | 11 + .../python-experimental/docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../petstore/python-experimental/docs/List.md | 10 + .../python-experimental/docs/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/Model200Response.md | 12 + .../python-experimental/docs/ModelReturn.md | 11 + .../petstore/python-experimental/docs/Name.md | 14 + .../python-experimental/docs/NullableClass.md | 22 + .../python-experimental/docs/NumberOnly.md | 10 + .../python-experimental/docs/Order.md | 15 + .../docs/OuterComposite.md | 12 + .../python-experimental/docs/OuterEnum.md | 10 + .../docs/OuterEnumDefaultValue.md | 10 + .../docs/OuterEnumInteger.md | 10 + .../docs/OuterEnumIntegerDefaultValue.md | 10 + .../petstore/python-experimental/docs/Pet.md | 15 + .../python-experimental/docs/PetApi.md | 563 +++++ .../python-experimental/docs/ReadOnlyFirst.md | 11 + .../docs/SpecialModelName.md | 10 + .../python-experimental/docs/StoreApi.md | 233 ++ .../docs/StringBooleanMap.md | 10 + .../petstore/python-experimental/docs/Tag.md | 11 + .../petstore/python-experimental/docs/User.md | 17 + .../python-experimental/docs/UserApi.md | 437 ++++ .../petstore/python-experimental/git_push.sh | 58 + .../petstore_api/__init__.py | 87 + .../petstore_api/api/__init__.py | 12 + .../petstore_api/api/another_fake_api.py | 375 +++ .../petstore_api/api/default_api.py | 365 +++ .../petstore_api/api/fake_api.py | 2016 +++++++++++++++++ .../api/fake_classname_tags_123_api.py | 377 +++ .../petstore_api/api/pet_api.py | 1292 +++++++++++ .../petstore_api/api/store_api.py | 692 ++++++ .../petstore_api/api/user_api.py | 1111 +++++++++ .../petstore_api/api_client.py | 698 ++++++ .../petstore_api/configuration.py | 436 ++++ .../petstore_api/exceptions.py | 120 + .../petstore_api/model_utils.py | 876 +++++++ .../petstore_api/models/__init__.py | 66 + .../models/additional_properties_class.py | 252 +++ .../petstore_api/models/animal.py | 270 +++ .../petstore_api/models/api_response.py | 270 +++ .../models/array_of_array_of_number_only.py | 234 ++ .../models/array_of_number_only.py | 234 ++ .../petstore_api/models/array_test.py | 271 +++ .../petstore_api/models/capitalization.py | 326 +++ .../petstore_api/models/cat.py | 272 +++ .../petstore_api/models/cat_all_of.py | 234 ++ .../petstore_api/models/category.py | 254 +++ .../petstore_api/models/class_model.py | 234 ++ .../petstore_api/models/client.py | 234 ++ .../petstore_api/models/dog.py | 272 +++ .../petstore_api/models/dog_all_of.py | 234 ++ .../petstore_api/models/enum_arrays.py | 260 +++ .../petstore_api/models/enum_class.py | 226 ++ .../petstore_api/models/enum_test.py | 384 ++++ .../petstore_api/models/file.py | 236 ++ .../models/file_schema_test_class.py | 253 +++ .../petstore_api/models/foo.py | 234 ++ .../petstore_api/models/format_test.py | 536 +++++ .../petstore_api/models/has_only_read_only.py | 252 +++ .../models/health_check_result.py | 234 ++ .../petstore_api/models/inline_object.py | 256 +++ .../petstore_api/models/inline_object1.py | 256 +++ .../petstore_api/models/inline_object2.py | 265 +++ .../petstore_api/models/inline_object3.py | 535 +++++ .../petstore_api/models/inline_object4.py | 259 +++ .../petstore_api/models/inline_object5.py | 258 +++ .../models/inline_response_default.py | 235 ++ .../petstore_api/models/list.py | 234 ++ .../petstore_api/models/map_test.py | 293 +++ ...perties_and_additional_properties_class.py | 271 +++ .../petstore_api/models/model200_response.py | 252 +++ .../petstore_api/models/model_return.py | 234 ++ .../petstore_api/models/name.py | 290 +++ .../petstore_api/models/nullable_class.py | 432 ++++ .../petstore_api/models/number_only.py | 234 ++ .../petstore_api/models/order.py | 331 +++ .../petstore_api/models/outer_composite.py | 270 +++ .../petstore_api/models/outer_enum.py | 227 ++ .../models/outer_enum_default_value.py | 226 ++ .../petstore_api/models/outer_enum_integer.py | 226 ++ .../outer_enum_integer_default_value.py | 226 ++ .../petstore_api/models/pet.py | 336 +++ .../petstore_api/models/read_only_first.py | 252 +++ .../petstore_api/models/special_model_name.py | 234 ++ .../petstore_api/models/string_boolean_map.py | 216 ++ .../petstore_api/models/tag.py | 252 +++ .../petstore_api/models/user.py | 362 +++ .../python-experimental/petstore_api/rest.py | 296 +++ .../python-experimental/requirements.txt | 6 + .../petstore/python-experimental/setup.py | 45 + .../python-experimental/test-requirements.txt | 7 + .../python-experimental/test/__init__.py | 0 .../test/test_additional_properties_class.py | 39 + .../python-experimental/test/test_animal.py | 39 + .../test/test_another_fake_api.py | 40 + .../test/test_api_response.py | 39 + .../test_array_of_array_of_number_only.py | 39 + .../test/test_array_of_number_only.py | 39 + .../test/test_array_test.py | 39 + .../test/test_capitalization.py | 39 + .../python-experimental/test/test_cat.py | 39 + .../test/test_cat_all_of.py | 39 + .../python-experimental/test/test_category.py | 39 + .../test/test_class_model.py | 39 + .../python-experimental/test/test_client.py | 39 + .../test/test_default_api.py | 39 + .../python-experimental/test/test_dog.py | 39 + .../test/test_dog_all_of.py | 39 + .../test/test_enum_arrays.py | 39 + .../test/test_enum_class.py | 39 + .../test/test_enum_test.py | 39 + .../python-experimental/test/test_fake_api.py | 124 + .../test/test_fake_classname_tags_123_api.py | 40 + .../python-experimental/test/test_file.py | 39 + .../test/test_file_schema_test_class.py | 39 + .../python-experimental/test/test_foo.py | 39 + .../test/test_format_test.py | 39 + .../test/test_has_only_read_only.py | 39 + .../test/test_health_check_result.py | 39 + .../test/test_inline_object.py | 39 + .../test/test_inline_object1.py | 39 + .../test/test_inline_object2.py | 39 + .../test/test_inline_object3.py | 39 + .../test/test_inline_object4.py | 39 + .../test/test_inline_object5.py | 39 + .../test/test_inline_response_default.py | 39 + .../python-experimental/test/test_list.py | 39 + .../python-experimental/test/test_map_test.py | 39 + ...perties_and_additional_properties_class.py | 39 + .../test/test_model200_response.py | 39 + .../test/test_model_return.py | 39 + .../python-experimental/test/test_name.py | 39 + .../test/test_nullable_class.py | 39 + .../test/test_number_only.py | 39 + .../python-experimental/test/test_order.py | 39 + .../test/test_outer_composite.py | 39 + .../test/test_outer_enum.py | 39 + .../test/test_outer_enum_default_value.py | 39 + .../test/test_outer_enum_integer.py | 39 + .../test_outer_enum_integer_default_value.py | 39 + .../python-experimental/test/test_pet.py | 39 + .../python-experimental/test/test_pet_api.py | 96 + .../test/test_read_only_first.py | 39 + .../test/test_special_model_name.py | 39 + .../test/test_store_api.py | 61 + .../test/test_string_boolean_map.py | 39 + .../python-experimental/test/test_tag.py | 39 + .../python-experimental/test/test_user.py | 39 + .../python-experimental/test/test_user_api.py | 89 + .../python-experimental/tests/__init__.py | 0 .../tests/test_api_client.py | 225 ++ .../petstore/python-experimental/tox.ini | 10 + .../openapi3/client/petstore/python/README.md | 5 + .../python/petstore_api/configuration.py | 31 +- 203 files changed, 28719 insertions(+), 54 deletions(-) create mode 100755 bin/openapi3/python-experimental-petstore.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/.gitignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/python-experimental/.travis.yml create mode 100644 samples/openapi3/client/petstore/python-experimental/README.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Category.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Client.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/File.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/List.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Name.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Order.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/User.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/git_push.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py create mode 100644 samples/openapi3/client/petstore/python-experimental/requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/test/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tox.ini diff --git a/bin/openapi3/python-experimental-petstore.sh b/bin/openapi3/python-experimental-petstore.sh new file mode 100755 index 000000000000..7b4007372b23 --- /dev/null +++ b/bin/openapi3/python-experimental-petstore.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index ea51d6ff5593..85bb172d6239 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -30,7 +30,7 @@ public class CodegenSecurity { public String scheme; public Boolean hasMore, isBasic, isOAuth, isApiKey; // is Basic is true for all http authentication type. Those are to differentiate basic and bearer authentication - public Boolean isBasicBasic, isBasicBearer; + public Boolean isBasicBasic, isBasicBearer, isHttpSignature; public String bearerFormat; public Map vendorExtensions = new HashMap(); // ApiKey specific @@ -58,6 +58,7 @@ public boolean equals(Object o) { Objects.equals(hasMore, that.hasMore) && Objects.equals(isBasic, that.isBasic) && Objects.equals(isBasicBasic, that.isBasicBasic) && + Objects.equals(isHttpSignature, that.isHttpSignature) && Objects.equals(isBasicBearer, that.isBasicBearer) && Objects.equals(bearerFormat, that.bearerFormat) && Objects.equals(isOAuth, that.isOAuth) && @@ -84,6 +85,7 @@ public int hashCode() { hasMore, isBasic, isBasicBasic, + isHttpSignature, isBasicBearer, bearerFormat, isOAuth, @@ -112,6 +114,7 @@ public CodegenSecurity filterByScopeNames(List filterScopes) { filteredSecurity.isBasic = isBasic; filteredSecurity.isBasicBasic = isBasicBasic; filteredSecurity.isBasicBearer = isBasicBearer; + filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isApiKey = isApiKey; filteredSecurity.isOAuth = isOAuth; filteredSecurity.keyParamName = keyParamName; 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 c2347eabfdbc..d7b0c4f4e406 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 @@ -3406,6 +3406,7 @@ public List fromSecurity(Map securitySc cs.name = key; cs.type = securityScheme.getType().toString(); cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = false; + cs.isHttpSignature = false; cs.isBasicBasic = cs.isBasicBearer = false; cs.scheme = securityScheme.getScheme(); @@ -3424,6 +3425,10 @@ public List fromSecurity(Map securitySc } else if ("bearer".equals(securityScheme.getScheme())) { cs.isBasicBearer = true; cs.bearerFormat = securityScheme.getBearerFormat(); + } else if ("signature".equals(securityScheme.getScheme())) { + cs.isHttpSignature = true; + } else { + throw new RuntimeException("Unsupported security scheme: " + securityScheme.getScheme()); } } else if (SecurityScheme.Type.OAUTH2.equals(securityScheme.getType())) { cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isBasic = false; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 7f56122e52c4..1777241e3a99 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -851,6 +851,9 @@ private Map buildSupportFileBundle(List allOperations, L if (hasBearerMethods(authMethods)) { bundle.put("hasBearerMethods", true); } + if (hasHttpSignatureMethods(authMethods)) { + bundle.put("hasHttpSignatureMethods", true); + } } List servers = config.fromServers(openAPI.getServers()); @@ -1331,6 +1334,16 @@ private boolean hasBearerMethods(List authMethods) { return false; } + private boolean hasHttpSignatureMethods(List authMethods) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isHttpSignature)) { + return true; + } + } + + return false; + } + private List getOAuthMethods(List authMethods) { List oauthMethods = new ArrayList<>(); diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 9ef4fb76ab00..1f4f4345a4f1 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -8,6 +8,10 @@ import logging {{^asyncio}} import multiprocessing {{/asyncio}} +{{#hasHttpSignatureMethods}} +import pem +from Crypto.PublicKey import RSA, ECC +{{/hasHttpSignatureMethods}} import sys import urllib3 @@ -26,12 +30,17 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + :param private_key_path: The path of the file containing a private key, when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. Supported values is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. """ def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -61,13 +70,18 @@ class Configuration(object): """Password for HTTP basic authentication """ self.key_id = key_id - """ The identifier of the key used to sign HTTP requests. + """The identifier of the key used to sign HTTP requests. """ self.private_key_path = private_key_path - """ The path of the file containing a private key, used to sign HTTP requests. + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. Supported values are rsa-sha256, rsa-sha512, hs2019. + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers """A list of HTTP headers that must be signed, when signing HTTP requests. @@ -123,6 +137,12 @@ class Configuration(object): """Set this to True/False to enable/disable SSL hostname verification. """ +{{#hasHttpSignatureMethods}} + self.private_key = None + """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. + """ +{{/hasHttpSignatureMethods}} + {{#asyncio}} self.connection_pool_maxsize = 100 """This value is passed to the aiohttp to limit simultaneous connections. @@ -281,7 +301,7 @@ class Configuration(object): }, {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} '{{name}}': { 'type': 'basic', @@ -289,7 +309,7 @@ class Configuration(object): 'key': 'Authorization', 'value': self.get_basic_auth_token() }, - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} '{{name}}': { @@ -302,6 +322,15 @@ class Configuration(object): 'value': 'Bearer ' + self.access_token }, {{/isBasicBearer}} + {{#isHttpSignature}} + '{{name}}': + { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + }, + {{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} '{{name}}': @@ -315,6 +344,27 @@ class Configuration(object): {{/authMethods}} } +{{#hasHttpSignatureMethods}} + def load_private_key(self): + """Load the private key used to sign HTTP requests. + """ + if self.private_key is not None: + return + with open(self.private_key_path, "rb") as f: + # Decode PEM file and determine key type from PEM header. + # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". + keys = pem.parse(f.read()) + if len(keys) != 1: + raise Exception("File must contain exactly one private key") + key = keys[0].as_text() + if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): + self.private_key = RSA.importKey(key) + elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): + self.private_key = ECC.importKey(key) + else: + raise Exception("Unsupported key") +{{/hasHttpSignatureMethods}} + def to_debug_report(self): """Gets the essential information for debugging. diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index b8e8d2d97129..ef64540102ce 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -9,11 +9,13 @@ import os # python 2 and python 3 compatibility library import six -from six.moves.urllib.parse import quote -from Crypto.PublicKey import RSA -from Crypto.Signature import PKCS1_v1_5 -from Crypto.Hash import SHA256 +from six.moves.urllib.parse import quote, urlencode, urlparse +{{#hasHttpSignatureMethods}} +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from Crypto.Hash import SHA256, SHA512 from base64 import b64encode +{{/hasHttpSignatureMethods}} {{#tornado}} import tornado.gen {{/tornado}} @@ -155,7 +157,7 @@ class ApiClient(object): post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) + self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) # body if body: @@ -521,12 +523,15 @@ class ApiClient(object): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: The HTTP request resource path. + :method: The HTTP request method. + :body: The body of the HTTP request. """ if not auth_settings: return @@ -534,6 +539,14 @@ class ApiClient(object): for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: +{{#hasHttpSignatureMethods}} + if auth_setting['type'] == 'http-signature': + # The HTTP signature scheme requires multiple HTTP headers that are calculated dynamically. + auth_headers = self.get_http_signature_headers(resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers[key] = value + continue +{{/hasHttpSignatureMethods}} if not auth_setting['value']: continue elif auth_setting['in'] == 'cookie': @@ -547,25 +560,31 @@ class ApiClient(object): 'Authentication token must be in `query` or `header`' ) - def prepare_auth_header(self, resource_path, method, body, query_params): +{{#hasHttpSignatureMethods}} + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): """ Create a message signature for the HTTP request and add the signed headers. :param resource_path : resource path which is the api being called upon. - :param method: request type + :param method: the HTTP request method. + :param headers: the request headers. :param body: body passed in the http request. :param query_params: query parameters used by the API :return: instance of digest object """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") if body is None: body = '' else: body = json.dumps(body) - target_host = urlparse(self.host).netloc - target_path = urlparse(self.host).path + target_host = urlparse(self.configuration.host).netloc + target_path = urlparse(self.configuration.host).path - request_target = method + " " + target_path + resource_path + request_target = method.lower() + " " + target_path + resource_path if query_params: raw_query = urlencode(query_params).replace('+', '%20') @@ -575,56 +594,86 @@ class ApiClient(object): cdate=formatdate(timeval=None, localtime=False, usegmt=True) request_body = body.encode() - body_digest = self.get_sha256_digest(request_body) + body_digest, digest_prefix = self.get_message_digest(request_body) b64_body_digest = b64encode(body_digest.digest()) - headers = {'Content-Type': 'application/json', 'Date' : cdate, 'Host' : target_host, 'Digest' : "SHA-256=" + b64_body_digest.decode('ascii')} - - string_to_sign = self.prepare_str_to_sign(request_target, headers) + signed_headers = { + 'Date': cdate, + 'Host': target_host, + 'Digest': digest_prefix + b64_body_digest.decode('ascii') + } + for hdr_key in self.configuration.signed_headers: + signed_headers[hdr_key] = headers[hdr_key] - digest = self.get_sha256_digest(string_to_sign.encode()) + string_to_sign = self.get_str_to_sign(request_target, signed_headers) - b64_signed_msg = self.get_rsasig_b64encode(self.private_key_file, digest) + digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) + b64_signed_msg = self.sign_digest(digest) - auth_header = self.get_auth_header(headers, b64_signed_msg) + auth_header = self.get_authorization_header(signed_headers, b64_signed_msg) - self.set_default_header('Date', '{0}'.format(cdate)) - self.set_default_header('Host', '{0}'.format(target_host)) - self.set_default_header('Digest', 'SHA-256={0}'.format(b64_body_digest.decode('ascii'))) - self.set_default_header('Authorization', '{0}'.format(auth_header)) + return { + 'Date': '{0}'.format(cdate), + 'Host': '{0}'.format(target_host), + 'Digest': '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')), + 'Authorization': '{0}'.format(auth_header) + } - def get_sha256_digest(self, data): + def get_message_digest(self, data): """ - :param data: Data set by User - :return: instance of digest object + Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The message to be hashed with a cryptographic hash. + :return: The message digest encoded as a byte string. """ - digest = SHA256.new() + if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: + digest = SHA512.new() + prefix = "SHA-512=" + elif self.configuration.signing_scheme in ["rsa-sha256"]: + digest = SHA256.new() + prefix = "SHA-256=" + else: + raise Exception("Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) digest.update(data) + return digest, prefix - return digest - - def get_rsasig_b64encode(self, private_key_path, digest): - """ - :param private_key_path : abs path to private key .pem file. - :param digest: digest - :return: instance of digest object + def sign_digest(self, digest): """ + Signs a message digest with a private key specified in the configuration. - key = open(private_key_path, "r").read() - rsakey = RSA.importKey(key) - signer = PKCS1_v1_5.new(rsakey) - sign = signer.sign(digest) - - return b64encode(sign) + :param digest: digest of the HTTP message. + :return: the HTTP message signature encoded as a byte string. + """ + self.configuration.load_private_key() + privkey = self.configuration.private_key + if isinstance(privkey, RSA.RsaKey): + if self.configuration.signing_algorithm == 'PSS': + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(privkey).sign(digest) + elif self.configuration.signing_algorithm == 'PKCS1-v1_5': + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(privkey).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + elif isinstance(privkey, ECC.EccKey): + if self.configuration.signing_algorithm in ['fips-186-3', 'deterministic-rfc6979']: + signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + else: + raise Exception("Unsupported private key: {0}".format(type(privkey))) + return b64encode(signature) - def prepare_str_to_sign(self, req_tgt, hdrs): + def get_str_to_sign(self, req_tgt, hdrs): """ + Generate and return a string value representing the HTTP request to be signed. + :param req_tgt : Request Target as stored in http header. :param hdrs: HTTP Headers to be signed. :return: instance of digest object """ ss = "" - ss = ss + "(request-target): " + req_tgt.lower() + "\n" + ss = ss + "(request-target): " + req_tgt + "\n" length = len(hdrs.items()) @@ -637,11 +686,11 @@ class ApiClient(object): return ss - def get_auth_header(self, hdrs, signed_msg): + def get_authorization_header(self, hdrs, signed_msg): """ - This method prepares the Auth header string + Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - :param hdrs : HTTP Headers + :param hdrs : The list of signed HTTP Headers :param signed_msg: Signed Digest :return: instance of digest object """ @@ -649,7 +698,7 @@ class ApiClient(object): auth_str = "" auth_str = auth_str + "Signature" - auth_str = auth_str + " " + "keyId=\"" + self.api_key_id + "\"," + "algorithm=\"" + self.digest_algorithm + "\"," + "headers=\"(request-target)" + auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" for key, _ in hdrs.items(): auth_str = auth_str + " " + key.lower() @@ -659,3 +708,4 @@ class ApiClient(object): return auth_str +{{/hasHttpSignatureMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache index bf9ffe07d08d..9fab9e020b0d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache @@ -23,6 +23,10 @@ REQUIRES.append("aiohttp >= 3.0.0") {{#tornado}} REQUIRES.append("tornado>=4.2,<5") {{/tornado}} +{{#hasHttpSignatureMethods}} +REQUIRES.append("pem>=19.3.0") +REQUIRES.append("pycryptodome>=3.9.0") +{{/hasHttpSignatureMethods}} EXTRAS = {':python_version <= "2.7"': ['future']} setup( diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index f6f35356afc3..d1787509bbbe 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1168,6 +1168,9 @@ components: type: http scheme: bearer bearerFormat: JWT + http_signature_test: + type: http + scheme: signature schemas: Foo: type: object diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 9a0c95c90458..370c8ea3bf2a 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -32,11 +32,16 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests + :param private_key_path: The path of the file containing a private key, when signing HTTP requests + :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -65,6 +70,18 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests + """ self.access_token = "" """access token for OAuth/Bearer """ @@ -107,6 +124,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Set this to True/False to enable/disable SSL hostname verification. """ + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is @@ -276,6 +294,7 @@ def auth_settings(self): }, } + def to_debug_report(self): """Gets the essential information for debugging. diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/petstore/python-experimental/.gitignore new file mode 100644 index 000000000000..a655050c2631 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION new file mode 100644 index 000000000000..e4955748d3e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml new file mode 100644 index 000000000000..86211e2d4a26 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -0,0 +1,14 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md new file mode 100644 index 000000000000..86cdecf7fd42 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -0,0 +1,216 @@ +# petstore-api +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 Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) +client = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*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 +*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 +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **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 + + +## bearer_test + +- **Type**: Bearer authentication (JWT) + + +## http_basic_test + +- **Type**: HTTP basic authentication + + +## http_signature_test + +- **Type**: HTTP basic authentication + + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..beb2e2d4f1ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **{str: (str,)}** | | [optional] +**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md new file mode 100644 index 000000000000..e59166a62e83 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md @@ -0,0 +1,11 @@ +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..9e19b330e9a9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -0,0 +1,63 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call_123_test_special_tags** +> Client call_123_test_special_tags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +client = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md new file mode 100644 index 000000000000..8fc302305abe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..1a68df0090bb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **[[float]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..b8a760f56dc2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **[float]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md new file mode 100644 index 000000000000..c677e324ad47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **[str]** | | [optional] +**array_array_of_integer** | **[[int]]** | | [optional] +**array_array_of_model** | **[[ReadOnlyFirst]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md new file mode 100644 index 000000000000..85d88d239ee7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md new file mode 100644 index 000000000000..8bdbf9b3bcca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md @@ -0,0 +1,12 @@ +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**declawed** | **bool** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md new file mode 100644 index 000000000000..35434374fc97 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md new file mode 100644 index 000000000000..33b2242d703f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | defaults to 'default-name' +**id** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md new file mode 100644 index 000000000000..657d51a944de --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md @@ -0,0 +1,11 @@ +# ClassModel + +Model for testing model with \"_class\" property +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md new file mode 100644 index 000000000000..88e99384f92c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Client.md @@ -0,0 +1,10 @@ +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md new file mode 100644 index 000000000000..92e27f40a24c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -0,0 +1,56 @@ +# petstore_api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | + + +# **foo_get** +> InlineResponseDefault foo_get() + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.DefaultApi() + +try: + api_response = api_instance.foo_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md new file mode 100644 index 000000000000..81de56780725 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md @@ -0,0 +1,12 @@ +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**breed** | **str** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md new file mode 100644 index 000000000000..36d3216f7b35 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md new file mode 100644 index 000000000000..e0b5582e9d5b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md new file mode 100644 index 000000000000..510dff4df0cf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -0,0 +1,10 @@ +# EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md new file mode 100644 index 000000000000..5e2263ee5e00 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -0,0 +1,17 @@ +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string_required** | **str** | | +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md new file mode 100644 index 000000000000..2b503b7d4d8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -0,0 +1,828 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | + + +# **fake_health_get** +> HealthCheckResult fake_health_get() + +Health check endpoint + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() + +try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[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) + +# **fake_outer_boolean_serialize** +> bool fake_outer_boolean_serialize() + + + +Test serialization of outer boolean types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = True # bool | Input boolean as post body (optional) + +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + +[[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) + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize() + + + +Test serialization of object with outer number type + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) + +try: + api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + +[[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) + +# **fake_outer_number_serialize** +> float fake_outer_number_serialize() + + + +Test serialization of outer number types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 3.4 # float | Input number as post body (optional) + +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **float**| Input number as post body | [optional] + +### Return type + +**float** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + +[[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) + +# **fake_outer_string_serialize** +> str fake_outer_string_serialize() + + + +Test serialization of outer string types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 'body_example' # str | Input string as post body (optional) + +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| Input string as post body | [optional] + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_file_schema** +> test_body_with_file_schema(file_schema_test_class) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | + +try: + api_instance.test_body_with_file_schema(file_schema_test_class) +except ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_query_params** +> test_body_with_query_params(query, user) + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +query = 'query_example' # str | +user = petstore_api.User() # User | + +try: + api_instance.test_body_with_query_params(query, user) +except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **str**| | + **user** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_client_model** +> Client test_client_model(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +client = petstore_api.Client() # Client | client model + +try: + # To test \"client\" model + api_response = api_instance.test_client_model(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +* Basic Authentication (http_basic_test): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure HTTP basic authorization: http_basic_test +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +number = 3.4 # float | None +double = 3.4 # float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None +byte = 'byte_example' # str | None +integer = 56 # int | None (optional) +int32 = 56 # int | None (optional) +int64 = 56 # int | None (optional) +float = 3.4 # float | None (optional) +string = 'string_example' # str | None (optional) +binary = open('/path/to/file', 'rb') # file_type | None (optional) +date = '2013-10-20' # date | None (optional) +date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) +password = 'password_example' # str | None (optional) +param_callback = 'param_callback_example' # str | None (optional) + +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **file_type**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_enum_parameters** +> test_enum_parameters() + +To test enum parameters + +To test enum parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') +enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') +enum_query_integer = 56 # int | Query parameter enum test (double) (optional) +enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) +enum_form_string_array = '$' # [str] | Form parameter enum test (string array) (optional) (default to '$') +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') + +try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) +except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | [**[str]**](str.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_string_array** | [**[str]**](str.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | [**[str]**](str.md)| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of '$' + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_group_parameters** +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +* Bearer (JWT) Authentication (bearer_test): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure Bearer authorization (JWT): bearer_test +configuration.access_token = 'YOUR_BEARER_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +required_string_group = 56 # int | Required String in group parameters +required_boolean_group = True # bool | Required Boolean in group parameters +required_int64_group = 56 # int | Required Integer in group parameters +string_group = 56 # int | String in group parameters (optional) +boolean_group = True # bool | Boolean in group parameters (optional) +int64_group = 56 # int | Integer in group parameters (optional) + +try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) +except ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | + **string_group** | **int**| String in group parameters | [optional] + **boolean_group** | **bool**| Boolean in group parameters | [optional] + **int64_group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_inline_additional_properties** +> test_inline_additional_properties(request_body) + +test inline additionalProperties + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +request_body = {'key': 'request_body_example'} # {str: (str,)} | request body + +try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) +except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**{str: (str,)}**](str.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +param = 'param_example' # str | field1 +param2 = 'param2_example' # str | field2 + +try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) +except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **str**| field1 | + **param2** | **str**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # [str] | +ioutil = ['ioutil_example'] # [str] | +http = ['http_example'] # [str] | +url = ['url_example'] # [str] | +context = ['context_example'] # [str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[str]**](str.md)| | + **ioutil** | [**[str]**](str.md)| | + **http** | [**[str]**](str.md)| | + **url** | [**[str]**](str.md)| | + **context** | [**[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..de59ba0d374f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -0,0 +1,71 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> Client test_classname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +* Api Key Authentication (api_key_query): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key_query +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) +client = petstore_api.Client() # Client | client model + +try: + # To test class name in snake case + api_response = api_instance.test_classname(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md new file mode 100644 index 000000000000..f17ba0057d04 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/File.md @@ -0,0 +1,11 @@ +# File + +Must be named `File` for test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **str** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..d0a8bbaaba95 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | | [optional] +**files** | [**[File]**](File.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md new file mode 100644 index 000000000000..5b281fa08de7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md @@ -0,0 +1,10 @@ +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] if omitted the server will use the default value of 'bar' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md new file mode 100644 index 000000000000..2ac0ffb36d33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md @@ -0,0 +1,24 @@ +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | | +**byte** | **str** | | +**date** | **date** | | +**password** | **str** | | +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**binary** | **file_type** | | [optional] +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..f731a42eab54 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**foo** | **str** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md new file mode 100644 index 000000000000..50cf84f69133 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md @@ -0,0 +1,11 @@ +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullable_message** | **str, none_type** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md new file mode 100644 index 000000000000..f567ea188ce0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the pet | [optional] +**status** | **str** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md new file mode 100644 index 000000000000..4349ad73e3b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **str** | Additional data to pass to server | [optional] +**file** | **file_type** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md new file mode 100644 index 000000000000..106488e8598e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md @@ -0,0 +1,11 @@ +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md new file mode 100644 index 000000000000..7a73a2c686b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md @@ -0,0 +1,23 @@ +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | None | +**double** | **float** | None | +**pattern_without_delimiter** | **str** | None | +**byte** | **str** | None | +**integer** | **int** | None | [optional] +**int32** | **int** | None | [optional] +**int64** | **int** | None | [optional] +**float** | **float** | None | [optional] +**string** | **str** | None | [optional] +**binary** | **file_type** | None | [optional] +**date** | **date** | None | [optional] +**date_time** | **datetime** | None | [optional] +**password** | **str** | None | [optional] +**callback** | **str** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md new file mode 100644 index 000000000000..07574d0d0769 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md @@ -0,0 +1,11 @@ +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **str** | field1 | +**param2** | **str** | field2 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md new file mode 100644 index 000000000000..8f8662c434db --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md @@ -0,0 +1,11 @@ +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**required_file** | **file_type** | file to upload | +**additional_metadata** | **str** | Additional data to pass to server | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..9c754420f24a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-experimental/docs/List.md new file mode 100644 index 000000000000..11f4f3a05f32 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/List.md @@ -0,0 +1,10 @@ +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md new file mode 100644 index 000000000000..ad561b7220bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md @@ -0,0 +1,13 @@ +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] +**map_of_enum_string** | **{str: (str,)}** | | [optional] +**direct_map** | **{str: (bool,)}** | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..1484c0638d83 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md new file mode 100644 index 000000000000..40d0d7828e14 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md @@ -0,0 +1,12 @@ +# Model200Response + +Model for testing model name starting with number +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md new file mode 100644 index 000000000000..65ec73ddae78 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md @@ -0,0 +1,11 @@ +# ModelReturn + +Model for testing reserved words +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md new file mode 100644 index 000000000000..807b76afc6ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Name.md @@ -0,0 +1,14 @@ +# Name + +Model for testing model name same as property name +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] [readonly] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md new file mode 100644 index 000000000000..8d6bd66098bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md @@ -0,0 +1,22 @@ +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer_prop** | **int, none_type** | | [optional] +**number_prop** | **float, none_type** | | [optional] +**boolean_prop** | **bool, none_type** | | [optional] +**string_prop** | **str, none_type** | | [optional] +**date_prop** | **date, none_type** | | [optional] +**datetime_prop** | **datetime, none_type** | | [optional] +**array_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str], none_type** | | [optional] +**array_and_items_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str, none_type], none_type** | | [optional] +**array_items_nullable** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [optional] +**object_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str,)}, none_type** | | [optional] +**object_and_items_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**object_items_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md new file mode 100644 index 000000000000..93a0fde7b931 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md new file mode 100644 index 000000000000..c21210a3bd59 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] if omitted the server will use the default value of False + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md new file mode 100644 index 000000000000..bab07ad559eb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | **float** | | [optional] +**my_string** | **str** | | [optional] +**my_boolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md new file mode 100644 index 000000000000..7ddfca906e90 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md @@ -0,0 +1,10 @@ +# OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str, none_type** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..2d5a02f98f38 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md @@ -0,0 +1,10 @@ +# OuterEnumDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to 'placed' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..21e90bebf945 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md @@ -0,0 +1,10 @@ +# OuterEnumInteger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..e8994703c347 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,10 @@ +# OuterEnumIntegerDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | defaults to 0 + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md new file mode 100644 index 000000000000..ce09d401c899 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**photo_urls** | **[str]** | | +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**[Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md new file mode 100644 index 000000000000..0c5c6364803c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -0,0 +1,563 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**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) + + +# **add_pet** +> add_pet(pet) + +Add a new pet to the store + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Add a new pet to the store + api_instance.add_pet(pet) +except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[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) + +# **delete_pet** +> delete_pet(pet_id) + +Deletes a pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | Pet id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) +except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid pet value | - | + +[[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) + +# **find_pets_by_status** +> [Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +status = ['status_example'] # [str] | Status values that need to be considered for filter + +try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**[str]**](str.md)| Status values that need to be considered for filter | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + +[[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) + +# **find_pets_by_tags** +> [Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +tags = ['tags_example'] # [str] | Tags to filter by + +try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**[str]**](str.md)| Tags to filter by | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + +[[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) + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to return + +try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + +[[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) + +Update an existing pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Update an existing pet + api_instance.update_pet(pet) +except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + +[[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_with_form** +> update_pet_with_form(pet_id) + +Updates a pet in the store with form data + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet that needs to be updated +name = 'name_example' # str | Updated name of the pet (optional) +status = 'status_example' # str | Updated status of the pet (optional) + +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) +except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[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) + +# **upload_file** +> ApiResponse upload_file(pet_id) + +uploads an image + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +file = open('/path/to/file', 'rb') # file_type | file to upload (optional) + +try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file_type**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **upload_file_with_required_file** +> ApiResponse upload_file_with_required_file(pet_id, required_file) + +uploads an image (required) + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +required_file = open('/path/to/file', 'rb') # file_type | file to upload +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) + +try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **required_file** | **file_type**| file to upload | + **additional_metadata** | **str**| 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..6bc1447c1d71 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**baz** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md new file mode 100644 index 000000000000..022ee19169ce --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md new file mode 100644 index 000000000000..3ffdb4942432 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -0,0 +1,233 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**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/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 'order_id_example' # str | ID of the order that needs to be deleted + +try: + # Delete purchase order by ID + api_instance.delete_order(order_id) +except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[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) + +# **get_inventory** +> {str: (int,)} get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) + +try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**{str: (int,)}** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 56 # int | ID of pet that needs to be fetched + +try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[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** +> Order place_order(order) + +Place an order for a pet + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order = petstore_api.Order() # Order | order placed for purchasing the pet + +try: + # Place an order for a pet + api_response = api_instance.place_order(order) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md new file mode 100644 index 000000000000..2fbf3b3767d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -0,0 +1,10 @@ +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md new file mode 100644 index 000000000000..243cd98eda69 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md new file mode 100644 index 000000000000..443ac123fdca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md new file mode 100644 index 000000000000..b5b208e87bb2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -0,0 +1,437 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user = petstore_api.User() # User | Created user object + +try: + # Create user + api_instance.create_user(user) +except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user = [petstore_api.User()] # [User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(user) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user = [petstore_api.User()] # [User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(user) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be deleted + +try: + # Delete user + api_instance.delete_user(username) +except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[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) + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + +try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[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) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The user name for login +password = 'password_example' # str | The password for login in clear text + +try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +**400** | Invalid username/password supplied | - | + +[[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) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() + +try: + # Logs out current logged in user session + api_instance.logout_user() +except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | name that need to be deleted +user = petstore_api.User() # User | Updated user object + +try: + # Updated user + api_instance.update_user(username, user) +except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-experimental/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/git_push.sh @@ -0,0 +1,58 @@ +#!/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" + +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" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +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. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +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 + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +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" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py new file mode 100644 index 000000000000..49b0eeb464ea --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +# flake8: noqa + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0" + +# import apis into sdk package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi + +# import ApiClient +from petstore_api.api_client import ApiClient +from petstore_api.configuration import Configuration +from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiTypeError +from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiKeyError +from petstore_api.exceptions import ApiException +# import models into sdk package +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass +from petstore_api.models.animal import Animal +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly +from petstore_api.models.array_test import ArrayTest +from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat +from petstore_api.models.cat_all_of import CatAllOf +from petstore_api.models.category import Category +from petstore_api.models.class_model import ClassModel +from petstore_api.models.client import Client +from petstore_api.models.dog import Dog +from petstore_api.models.dog_all_of import DogAllOf +from petstore_api.models.enum_arrays import EnumArrays +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.enum_test import EnumTest +from petstore_api.models.file import File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.foo import Foo +from petstore_api.models.format_test import FormatTest +from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inline_object import InlineObject +from petstore_api.models.inline_object1 import InlineObject1 +from petstore_api.models.inline_object2 import InlineObject2 +from petstore_api.models.inline_object3 import InlineObject3 +from petstore_api.models.inline_object4 import InlineObject4 +from petstore_api.models.inline_object5 import InlineObject5 +from petstore_api.models.inline_response_default import InlineResponseDefault +from petstore_api.models.list import List +from petstore_api.models.map_test import MapTest +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.models.model200_response import Model200Response +from petstore_api.models.model_return import ModelReturn +from petstore_api.models.name import Name +from petstore_api.models.nullable_class import NullableClass +from petstore_api.models.number_only import NumberOnly +from petstore_api.models.order import Order +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue +from petstore_api.models.pet import Pet +from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap +from petstore_api.models.tag import Tag +from petstore_api.models.user import User + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py new file mode 100644 index 000000000000..fa4e54a80091 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -0,0 +1,12 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py new file mode 100644 index 000000000000..89594ed2adbc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.client import Client + + +class AnotherFakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __call_123_test_special_tags(self, client, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.call_123_test_special_tags(client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Client client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client'] = client + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [], + 'endpoint_path': '/another-fake/dummy', + 'operation_id': 'call_123_test_special_tags', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client', + ], + 'required': [ + 'client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client': (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__call_123_test_special_tags + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py new file mode 100644 index 000000000000..bbd4f2584287 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -0,0 +1,365 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.inline_response_default import InlineResponseDefault + + +class DefaultApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __foo_get(self, **kwargs): # noqa: E501 + """foo_get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.foo_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: InlineResponseDefault + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.foo_get = Endpoint( + settings={ + 'response_type': (InlineResponseDefault,), + 'auth': [], + 'endpoint_path': '/foo', + 'operation_id': 'foo_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__foo_get + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py new file mode 100644 index 000000000000..a50900f88f99 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -0,0 +1,2016 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.client import Client +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.user import User + + +class FakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __fake_health_get(self, **kwargs): # noqa: E501 + """Health check endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_health_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: HealthCheckResult + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_health_get = Endpoint( + settings={ + 'response_type': (HealthCheckResult,), + 'auth': [], + 'endpoint_path': '/fake/health', + 'operation_id': 'fake_health_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_health_get + ) + + def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param bool body: Input boolean as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_boolean_serialize = Endpoint( + settings={ + 'response_type': (bool,), + 'auth': [], + 'endpoint_path': '/fake/outer/boolean', + 'operation_id': 'fake_outer_boolean_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': (bool,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_boolean_serialize + ) + + def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param OuterComposite outer_composite: Input composite as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: OuterComposite + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_composite_serialize = Endpoint( + settings={ + 'response_type': (OuterComposite,), + 'auth': [], + 'endpoint_path': '/fake/outer/composite', + 'operation_id': 'fake_outer_composite_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'outer_composite', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'outer_composite': (OuterComposite,), + }, + 'attribute_map': { + }, + 'location_map': { + 'outer_composite': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_composite_serialize + ) + + def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float body: Input number as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: float + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_number_serialize = Endpoint( + settings={ + 'response_type': (float,), + 'auth': [], + 'endpoint_path': '/fake/outer/number', + 'operation_id': 'fake_outer_number_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': (float,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_number_serialize + ) + + def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str body: Input string as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_string_serialize = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/fake/outer/string', + 'operation_id': 'fake_outer_string_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': (str,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_string_serialize + ) + + def __test_body_with_file_schema(self, file_schema_test_class, **kwargs): # noqa: E501 + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param FileSchemaTestClass file_schema_test_class: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['file_schema_test_class'] = file_schema_test_class + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-file-schema', + 'operation_id': 'test_body_with_file_schema', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'file_schema_test_class', + ], + 'required': [ + 'file_schema_test_class', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'file_schema_test_class': (FileSchemaTestClass,), + }, + 'attribute_map': { + }, + 'location_map': { + 'file_schema_test_class': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_file_schema + ) + + def __test_body_with_query_params(self, query, user, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_query_params(query, user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str query: (required) + :param User user: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['query'] = query + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-query-params', + 'operation_id': 'test_body_with_query_params', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'query', + 'user', + ], + 'required': [ + 'query', + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'query': (str,), + 'user': (User,), + }, + 'attribute_map': { + 'query': 'query', + }, + 'location_map': { + 'query': 'query', + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_query_params + ) + + def __test_client_model(self, client, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Client client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client'] = client + return self.call_with_http_info(**kwargs) + + self.test_client_model = Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_client_model', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client', + ], + 'required': [ + 'client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client': (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_client_model + ) + + def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param file_type binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['number'] = number + kwargs['double'] = double + kwargs['pattern_without_delimiter'] = pattern_without_delimiter + kwargs['byte'] = byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'http_basic_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_endpoint_parameters', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + 'integer', + 'int32', + 'int64', + 'float', + 'string', + 'binary', + 'date', + 'date_time', + 'password', + 'param_callback', + ], + 'required': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'integer', + 'int32', + 'float', + 'string', + 'password', + ] + }, + root_map={ + 'validations': { + ('number',): { + + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + + 'inclusive_maximum': 987.6, + }, + ('string',): { + + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'number': (float,), + 'double': (float,), + 'pattern_without_delimiter': (str,), + 'byte': (str,), + 'integer': (int,), + 'int32': (int,), + 'int64': (int,), + 'float': (float,), + 'string': (str,), + 'binary': (file_type,), + 'date': (date,), + 'date_time': (datetime,), + 'password': (str,), + 'param_callback': (str,), + }, + 'attribute_map': { + 'number': 'number', + 'double': 'double', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'float': 'float', + 'string': 'string', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'param_callback': 'callback', + }, + 'location_map': { + 'number': 'form', + 'double': 'form', + 'pattern_without_delimiter': 'form', + 'byte': 'form', + 'integer': 'form', + 'int32': 'form', + 'int64': 'form', + 'float': 'form', + 'string': 'form', + 'binary': 'form', + 'date': 'form', + 'date_time': 'form', + 'password': 'form', + 'param_callback': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_endpoint_parameters + ) + + def __test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param [str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :param [str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_enum_parameters', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('enum_header_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_header_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_query_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_integer',): { + + "1": 1, + "-2": -2 + }, + ('enum_query_double',): { + + "1.1": 1.1, + "-1.2": -1.2 + }, + ('enum_form_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_form_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + }, + 'openapi_types': { + 'enum_header_string_array': ([str],), + 'enum_header_string': (str,), + 'enum_query_string_array': ([str],), + 'enum_query_string': (str,), + 'enum_query_integer': (int,), + 'enum_query_double': (float,), + 'enum_form_string_array': ([str],), + 'enum_form_string': (str,), + }, + 'attribute_map': { + 'enum_header_string_array': 'enum_header_string_array', + 'enum_header_string': 'enum_header_string', + 'enum_query_string_array': 'enum_query_string_array', + 'enum_query_string': 'enum_query_string', + 'enum_query_integer': 'enum_query_integer', + 'enum_query_double': 'enum_query_double', + 'enum_form_string_array': 'enum_form_string_array', + 'enum_form_string': 'enum_form_string', + }, + 'location_map': { + 'enum_header_string_array': 'header', + 'enum_header_string': 'header', + 'enum_query_string_array': 'query', + 'enum_query_string': 'query', + 'enum_query_integer': 'query', + 'enum_query_double': 'query', + 'enum_form_string_array': 'form', + 'enum_form_string': 'form', + }, + 'collection_format_map': { + 'enum_header_string_array': 'csv', + 'enum_query_string_array': 'multi', + 'enum_form_string_array': 'csv', + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_enum_parameters + ) + + def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int required_string_group: Required String in group parameters (required) + :param bool required_boolean_group: Required Boolean in group parameters (required) + :param int required_int64_group: Required Integer in group parameters (required) + :param int string_group: String in group parameters + :param bool boolean_group: Boolean in group parameters + :param int int64_group: Integer in group parameters + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['required_string_group'] = required_string_group + kwargs['required_boolean_group'] = required_boolean_group + kwargs['required_int64_group'] = required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'bearer_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_group_parameters', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + 'string_group', + 'boolean_group', + 'int64_group', + ], + 'required': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'required_string_group': (int,), + 'required_boolean_group': (bool,), + 'required_int64_group': (int,), + 'string_group': (int,), + 'boolean_group': (bool,), + 'int64_group': (int,), + }, + 'attribute_map': { + 'required_string_group': 'required_string_group', + 'required_boolean_group': 'required_boolean_group', + 'required_int64_group': 'required_int64_group', + 'string_group': 'string_group', + 'boolean_group': 'boolean_group', + 'int64_group': 'int64_group', + }, + 'location_map': { + 'required_string_group': 'query', + 'required_boolean_group': 'header', + 'required_int64_group': 'query', + 'string_group': 'query', + 'boolean_group': 'header', + 'int64_group': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_group_parameters + ) + + def __test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(request_body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param {str: (str,)} request_body: request body (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['request_body'] = request_body + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/inline-additionalProperties', + 'operation_id': 'test_inline_additional_properties', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'request_body', + ], + 'required': [ + 'request_body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'request_body': ({str: (str,)},), + }, + 'attribute_map': { + }, + 'location_map': { + 'request_body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_inline_additional_properties + ) + + def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str param: field1 (required) + :param str param2: field2 (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['param'] = param + kwargs['param2'] = param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/jsonFormData', + 'operation_id': 'test_json_form_data', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'param', + 'param2', + ], + 'required': [ + 'param', + 'param2', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': (str,), + 'param2': (str,), + }, + 'attribute_map': { + 'param': 'param', + 'param2': 'param2', + }, + 'location_map': { + 'param': 'form', + 'param2': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_json_form_data + ) + + def __test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] pipe: (required) + :param [str] ioutil: (required) + :param [str] http: (required) + :param [str] url: (required) + :param [str] context: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pipe'] = pipe + kwargs['ioutil'] = ioutil + kwargs['http'] = http + kwargs['url'] = url + kwargs['context'] = context + return self.call_with_http_info(**kwargs) + + self.test_query_parameter_collection_format = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/test-query-paramters', + 'operation_id': 'test_query_parameter_collection_format', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'required': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pipe': ([str],), + 'ioutil': ([str],), + 'http': ([str],), + 'url': ([str],), + 'context': ([str],), + }, + 'attribute_map': { + 'pipe': 'pipe', + 'ioutil': 'ioutil', + 'http': 'http', + 'url': 'url', + 'context': 'context', + }, + 'location_map': { + 'pipe': 'query', + 'ioutil': 'query', + 'http': 'query', + 'url': 'query', + 'context': 'query', + }, + 'collection_format_map': { + 'pipe': 'multi', + 'ioutil': 'csv', + 'http': 'space', + 'url': 'csv', + 'context': 'multi', + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_query_parameter_collection_format + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py new file mode 100644 index 000000000000..e4e38865cad5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -0,0 +1,377 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.client import Client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __test_classname(self, client, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Client client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client'] = client + return self.call_with_http_info(**kwargs) + + self.test_classname = Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client', + ], + 'required': [ + 'client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client': (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_classname + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py new file mode 100644 index 000000000000..da5c4a261249 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -0,0 +1,1292 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.pet import Pet + + +class PetApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __add_pet(self, pet, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Pet pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet'] = pet + return self.call_with_http_info(**kwargs) + + self.add_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'add_pet', + 'http_method': 'POST', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet', + ], + 'required': [ + 'pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet': (Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__add_pet + ) + + def __delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: Pet id to delete (required) + :param str api_key: + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'delete_pet', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'api_key', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'api_key': (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'api_key': 'api_key', + }, + 'location_map': { + 'pet_id': 'path', + 'api_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_pet + ) + + def __find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] status: Status values that need to be considered for filter (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['status'] = status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = Endpoint( + settings={ + 'response_type': ([Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByStatus', + 'operation_id': 'find_pets_by_status', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'status', + ], + 'required': [ + 'status', + ], + 'nullable': [ + ], + 'enum': [ + 'status', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('status',): { + + "AVAILABLE": "available", + "PENDING": "pending", + "SOLD": "sold" + }, + }, + 'openapi_types': { + 'status': ([str],), + }, + 'attribute_map': { + 'status': 'status', + }, + 'location_map': { + 'status': 'query', + }, + 'collection_format_map': { + 'status': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_status + ) + + def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] tags: Tags to filter by (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['tags'] = tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = Endpoint( + settings={ + 'response_type': ([Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByTags', + 'operation_id': 'find_pets_by_tags', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'tags', + ], + 'required': [ + 'tags', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tags': ([str],), + }, + 'attribute_map': { + 'tags': 'tags', + }, + 'location_map': { + 'tags': 'query', + }, + 'collection_format_map': { + 'tags': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_tags + ) + + def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to return (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = Endpoint( + settings={ + 'response_type': (Pet,), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'get_pet_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + }, + 'attribute_map': { + 'pet_id': 'petId', + }, + 'location_map': { + 'pet_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_pet_by_id + ) + + def __update_pet(self, pet, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Pet pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet'] = pet + return self.call_with_http_info(**kwargs) + + self.update_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'update_pet', + 'http_method': 'PUT', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet', + ], + 'required': [ + 'pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet': (Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__update_pet + ) + + def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'update_pet_with_form', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'name', + 'status', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'name': (str,), + 'status': (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'name': 'name', + 'status': 'status', + }, + 'location_map': { + 'pet_id': 'path', + 'name': 'form', + 'status': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__update_pet_with_form + ) + + def __upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file_type file: file to upload + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = Endpoint( + settings={ + 'response_type': (ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}/uploadImage', + 'operation_id': 'upload_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'additional_metadata', + 'file', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'additional_metadata': (str,), + 'file': (file_type,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'additional_metadata': 'additionalMetadata', + 'file': 'file', + }, + 'location_map': { + 'pet_id': 'path', + 'additional_metadata': 'form', + 'file': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file + ) + + def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param file_type required_file: file to upload (required) + :param str additional_metadata: Additional data to pass to server + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + kwargs['required_file'] = required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = Endpoint( + settings={ + 'response_type': (ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', + 'operation_id': 'upload_file_with_required_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'required_file', + 'additional_metadata', + ], + 'required': [ + 'pet_id', + 'required_file', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'required_file': (file_type,), + 'additional_metadata': (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'required_file': 'requiredFile', + 'additional_metadata': 'additionalMetadata', + }, + 'location_map': { + 'pet_id': 'path', + 'required_file': 'form', + 'additional_metadata': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file_with_required_file + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py new file mode 100644 index 000000000000..ee9baec15d5e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -0,0 +1,692 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.order import Order + + +class StoreApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str order_id: ID of the order that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'delete_order', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': (str,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_order + ) + + def __get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.get_inventory = Endpoint( + settings={ + 'response_type': ({str: (int,)},), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/store/inventory', + 'operation_id': 'get_inventory', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_inventory + ) + + def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int order_id: ID of pet that needs to be fetched (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = Endpoint( + settings={ + 'response_type': (Order,), + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'get_order_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'order_id', + ] + }, + root_map={ + 'validations': { + ('order_id',): { + + 'inclusive_maximum': 5, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': (int,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_order_by_id + ) + + def __place_order(self, order, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(order, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Order order: order placed for purchasing the pet (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order'] = order + return self.call_with_http_info(**kwargs) + + self.place_order = Endpoint( + settings={ + 'response_type': (Order,), + 'auth': [], + 'endpoint_path': '/store/order', + 'operation_id': 'place_order', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'order', + ], + 'required': [ + 'order', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order': (Order,), + }, + 'attribute_map': { + }, + 'location_map': { + 'order': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__place_order + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py new file mode 100644 index 000000000000..03b3226119df --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -0,0 +1,1111 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.user import User + + +class UserApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __create_user(self, user, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param User user: Created user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.create_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user', + 'operation_id': 'create_user', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user', + ], + 'required': [ + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user': (User,), + }, + 'attribute_map': { + }, + 'location_map': { + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_user + ) + + def __create_users_with_array_input(self, user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [User] user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithArray', + 'operation_id': 'create_users_with_array_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user', + ], + 'required': [ + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user': ([User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_array_input + ) + + def __create_users_with_list_input(self, user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [User] user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithList', + 'operation_id': 'create_users_with_list_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user', + ], + 'required': [ + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user': ([User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_list_input + ) + + def __delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + return self.call_with_http_info(**kwargs) + + self.delete_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'delete_user', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_user + ) + + def __get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = Endpoint( + settings={ + 'response_type': (User,), + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'get_user_by_name', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_user_by_name + ) + + def __login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + kwargs['password'] = password + return self.call_with_http_info(**kwargs) + + self.login_user = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/user/login', + 'operation_id': 'login_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'password', + ], + 'required': [ + 'username', + 'password', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + 'password': (str,), + }, + 'attribute_map': { + 'username': 'username', + 'password': 'password', + }, + 'location_map': { + 'username': 'query', + 'password': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__login_user + ) + + def __logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.logout_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/logout', + 'operation_id': 'logout_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__logout_user + ) + + def __update_user(self, username, user, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(username, user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: name that need to be deleted (required) + :param User user: Updated user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.update_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'update_user', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'user', + ], + 'required': [ + 'username', + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + 'user': (User,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__update_user + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py new file mode 100644 index 000000000000..2fc2090d9488 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -0,0 +1,698 @@ +# coding: utf-8 +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote, urlencode, urlparse +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from Crypto.Hash import SHA256, SHA512 +from base64 import b64encode + +from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.exceptions import ApiValueError +from petstore_api.model_utils import ( + ModelNormal, + ModelSimple, + date, + datetime, + deserialize_file, + file_type, + model_to_dict, + str, + validate_and_convert_types +) + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + # six.binary_type python2=str, python3=bytes + # six.text_type python2=unicode, python3=str + PRIMITIVE_TYPES = ( + (float, bool, six.binary_type, six.text_type) + six.integer_types + ) + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + elif isinstance(obj, ModelNormal): + # Convert model obj to dict + # Convert attribute name to json key in + # model definition for request + obj_dict = model_to_dict(obj, serialize=True) + elif isinstance(obj, ModelSimple): + return self.sanitize_for_serialization(obj.value) + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type, _check_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param _check_type: boolean, whether to check the types of the data + received from the server + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == (file_type,): + content_disposition = response.getheader("Content-Disposition") + return deserialize_file(response.data, self.configuration, + content_disposition=content_disposition) + + # fetch data from response object + try: + received_data = json.loads(response.data) + except ValueError: + received_data = response.data + + # store our data under the key of 'received_data' so users have some + # context if they are deserializing a string and the data type is wrong + deserialized_data = validate_and_convert_types( + received_data, + response_type, + ['received_data'], + True, + _check_type, + configuration=self.configuration + ) + return deserialized_data + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param files dict: key -> field name, value -> a list of open file + objects for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _check_type: boolean describing if the data back from the server + should have its type checked. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _check_type) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: None or a dict with key=param_name and + value is a list of open file objects + :return: List of tuples of form parameters with file data + """ + if files is None: + return [] + + params = [] + for param_name, file_instances in six.iteritems(files): + if file_instances is None: + # if the file field is nullable, skip None values + continue + for file_instance in file_instances: + if file_instance is None: + # if the file field is nullable, skip None values + continue + if file_instance.closed is True: + raise ApiValueError( + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name + ) + filename = os.path.basename(file_instance.name) + filedata = file_instance.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([param_name, tuple([filename, filedata, mimetype])])) + file_instance.close() + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: The HTTP request resource path. + :method: The HTTP request method. + :body: The body of the HTTP request. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['type'] == 'http-signature': + # The HTTP signature scheme requires multiple HTTP headers that are calculated dynamically. + auth_headers = self.get_http_signature_headers(resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers[key] = value + continue + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """ + Create a message signature for the HTTP request and add the signed headers. + + :param resource_path : resource path which is the api being called upon. + :param method: the HTTP request method. + :param headers: the request headers. + :param body: body passed in the http request. + :param query_params: query parameters used by the API + :return: instance of digest object + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + if body is None: + body = '' + else: + body = json.dumps(body) + + target_host = urlparse(self.configuration.host).netloc + target_path = urlparse(self.configuration.host).path + + request_target = method.lower() + " " + target_path + resource_path + + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query + + from email.utils import formatdate + cdate=formatdate(timeval=None, localtime=False, usegmt=True) + + request_body = body.encode() + body_digest, digest_prefix = self.get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + + signed_headers = { + 'Date': cdate, + 'Host': target_host, + 'Digest': digest_prefix + b64_body_digest.decode('ascii') + } + for hdr_key in self.configuration.signed_headers: + signed_headers[hdr_key] = headers[hdr_key] + + string_to_sign = self.get_str_to_sign(request_target, signed_headers) + + digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) + b64_signed_msg = self.sign_digest(digest) + + auth_header = self.get_authorization_header(signed_headers, b64_signed_msg) + + return { + 'Date': '{0}'.format(cdate), + 'Host': '{0}'.format(target_host), + 'Digest': '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')), + 'Authorization': '{0}'.format(auth_header) + } + + def get_message_digest(self, data): + """ + Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The message to be hashed with a cryptographic hash. + :return: The message digest encoded as a byte string. + """ + if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: + digest = SHA512.new() + prefix = "SHA-512=" + elif self.configuration.signing_scheme in ["rsa-sha256"]: + digest = SHA256.new() + prefix = "SHA-256=" + else: + raise Exception("Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) + digest.update(data) + return digest, prefix + + def sign_digest(self, digest): + """ + Signs a message digest with a private key specified in the configuration. + + :param digest: digest of the HTTP message. + :return: the HTTP message signature encoded as a byte string. + """ + self.configuration.load_private_key() + privkey = self.configuration.private_key + if isinstance(privkey, RSA.RsaKey): + if self.configuration.signing_algorithm == 'PSS': + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(privkey).sign(digest) + elif self.configuration.signing_algorithm == 'PKCS1-v1_5': + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(privkey).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + elif isinstance(privkey, ECC.EccKey): + if self.configuration.signing_algorithm in ['fips-186-3', 'deterministic-rfc6979']: + signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + else: + raise Exception("Unsupported private key: {0}".format(type(privkey))) + return b64encode(signature) + + def get_str_to_sign(self, req_tgt, hdrs): + """ + Generate and return a string value representing the HTTP request to be signed. + + :param req_tgt : Request Target as stored in http header. + :param hdrs: HTTP Headers to be signed. + :return: instance of digest object + """ + ss = "" + ss = ss + "(request-target): " + req_tgt + "\n" + + length = len(hdrs.items()) + + i = 0 + for key, value in hdrs.items(): + ss = ss + key.lower() + ": " + value + if i < length-1: + ss = ss + "\n" + i += 1 + + return ss + + def get_authorization_header(self, hdrs, signed_msg): + """ + Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param hdrs : The list of signed HTTP Headers + :param signed_msg: Signed Digest + :return: instance of digest object + """ + + auth_str = "" + auth_str = auth_str + "Signature" + + auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" + + for key, _ in hdrs.items(): + auth_str = auth_str + " " + key.lower() + auth_str = auth_str + "\"" + + auth_str = auth_str + "," + "signature=\"" + signed_msg.decode('ascii') + "\"" + + return auth_str + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py new file mode 100644 index 000000000000..5b100fcff6c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -0,0 +1,436 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import logging +import multiprocessing +import pem +from Crypto.PublicKey import RSA, ECC +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests + :param private_key_path: The path of the file containing a private key, when signing HTTP requests + :param signing_scheme: The signature scheme, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests + """ + + def __init__(self, host="http://petstore.swagger.io:80/v2", + api_key=None, api_key_prefix=None, + username="", password="", + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): + """Constructor + """ + self.host = host + """Default Base url + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests. + """ + self.access_token = "" + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.private_key = None + """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Disable client side validation + self.client_side_validation = True + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'api_key': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + }, + 'api_key_query': + { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + }, + 'bearer_test': + { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + 'http_basic_test': + { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + }, + 'http_signature_test': + { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + }, + 'petstore_auth': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + } + + def load_private_key(self): + """Load the private key used to sign HTTP requests. + """ + if self.private_key is not None: + return + with open(self.private_key_path, "rb") as f: + # Decode PEM file and determine key type from PEM header. + # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". + keys = pem.parse(f.read()) + if len(keys) != 1: + raise Exception("File must contain exactly one private key") + key = keys[0].as_text() + if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): + self.private_key = RSA.importKey(key) + elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): + self.private_key = ECC.importKey(key) + else: + raise Exception("Unsupported key") + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://{server}.swagger.io:{port}/v2", + 'description': "petstore server", + 'variables': { + 'server': { + 'description': "No description provided", + 'default_value': "petstore", + 'enum_values': [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + 'port': { + 'description': "No description provided", + 'default_value': "80", + 'enum_values': [ + "80", + "8080" + ] + } + } + }, + { + 'url': "https://localhost:8080/{version}", + 'description': "The local server", + 'variables': { + 'version': { + 'description': "No description provided", + 'default_value': "v2", + 'enum_values': [ + "v1", + "v2" + ] + } + } + } + ] + + def get_host_from_settings(self, index, variables={}): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :return: URL based on host settings + """ + + servers = self.get_host_settings() + + # check array index out of bound + if index < 0 or index >= len(servers): + raise ValueError( + "Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501 + .format(index, len(servers))) + + server = servers[index] + url = server['url'] + + # go through variable and assign a value + for variable_name in server['variables']: + if variable_name in variables: + if variables[variable_name] in server['variables'][ + variable_name]['enum_values']: + url = url.replace("{" + variable_name + "}", + variables[variable_name]) + else: + raise ValueError( + "The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501 + .format( + variable_name, variables[variable_name], + server['variables'][variable_name]['enum_values'])) + else: + # use default value + url = url.replace( + "{" + variable_name + "}", + server['variables'][variable_name]['default_value']) + + return url diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py new file mode 100644 index 000000000000..100be3e0540f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py new file mode 100644 index 000000000000..22d9ee459de7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -0,0 +1,876 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import copy +from datetime import date, datetime # noqa: F401 +import inspect +import os +import re +import tempfile + +from dateutil.parser import parse +import six + +from petstore_api.exceptions import ( + ApiKeyError, + ApiTypeError, + ApiValueError, +) + +none_type = type(None) +if six.PY3: + import io + file_type = io.IOBase + # these are needed for when other modules import str and int from here + str = str + int = int +else: + file_type = file # noqa: F821 + str_py2 = str + unicode_py2 = unicode # noqa: F821 + long_py2 = long # noqa: F821 + int_py2 = int + # this requires that the future library is installed + from builtins import int, str + + +class OpenApiModel(object): + """The base class for all OpenAPIModels""" + + +class ModelSimple(OpenApiModel): + """the parent class of models whose type != object in their + swagger/openapi""" + + +class ModelNormal(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi""" + + +COERCION_INDEX_BY_TYPE = { + ModelNormal: 0, + ModelSimple: 1, + none_type: 2, + list: 3, + dict: 4, + float: 5, + int: 6, + bool: 7, + datetime: 8, + date: 9, + str: 10, + file_type: 11, +} + +# these are used to limit what type conversions we try to do +# when we have a valid type already and we want to try converting +# to another type +UPCONVERSION_TYPE_PAIRS = ( + (str, datetime), + (str, date), + (list, ModelNormal), + (dict, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), +) + +COERCIBLE_TYPE_PAIRS = { + False: ( # client instantiation of a model with client data + # (dict, ModelNormal), + # (list, ModelNormal), + # (str, ModelSimple), + # (int, ModelSimple), + # (float, ModelSimple), + # (list, ModelSimple), + # (str, int), + # (str, float), + # (str, datetime), + # (str, date), + # (int, str), + # (float, str), + ), + True: ( # server -> client data + (dict, ModelNormal), + (list, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), + # (str, int), + # (str, float), + (str, datetime), + (str, date), + # (int, str), + # (float, str), + (str, file_type) + ), +} + + +def get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + Python2: + float and int will return int, where int is the python3 int backport + str and unicode will return str, where str is the python3 str backport + Note: float and int ARE both instances of int backport + Note: str_py2 and unicode_py2 are NOT both instances of str backport + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, type): + # input_value is a class + return input_value + elif isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, list): + return list + elif isinstance(input_value, dict): + return dict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, file_type): + return file_type + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + # for python2 input_value==long_instance -> return int + # where int is the python3 int backport + return int + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or + isinstance(input_value, str)): + return str + return type(input_value) + + +def check_allowed_values(allowed_values, input_variable_path, input_values): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + """ + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def check_validations(validations, input_variable_path, input_values): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking + """ + current_validations = validations[input_variable_path] + if ('max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if ('min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if ('max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if ('min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum') + if (any(item in current_validations for item in items)): + if isinstance(input_values, list): + max_val = max(input_values) + min_val = min(input_values) + elif isinstance(input_values, dict): + max_val = max(input_values.values()) + min_val = min(input_values.values()) + else: + max_val = input_values + min_val = input_values + + if ('exclusive_maximum' in current_validations and + max_val >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_maximum' in current_validations and + max_val > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if ('exclusive_minimum' in current_validations and + min_val <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_minimum' in current_validations and + min_val < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if ('regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + raise ApiValueError( + r"Invalid value for `%s`, must be a follow pattern or equal to " + r"`%s` with flags=`%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'], + flags + ) + ) + + +def order_response_types(required_types): + """Returns the required types sorted in coercion order + + Args: + required_types (list/tuple): collection of classes or instance of + list or dict with classs information inside it + + Returns: + (list): coercion order sorted collection of classes or instance + of list or dict with classs information inside it + """ + + def index_getter(class_or_instance): + if isinstance(class_or_instance, list): + return COERCION_INDEX_BY_TYPE[list] + elif isinstance(class_or_instance, dict): + return COERCION_INDEX_BY_TYPE[dict] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelNormal)): + return COERCION_INDEX_BY_TYPE[ModelNormal] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelSimple)): + return COERCION_INDEX_BY_TYPE[ModelSimple] + return COERCION_INDEX_BY_TYPE[class_or_instance] + + sorted_types = sorted( + required_types, + key=lambda class_or_instance: index_getter(class_or_instance) + ) + return sorted_types + + +def remove_uncoercible(required_types_classes, current_item, from_server, + must_convert=True): + """Only keeps the type conversions that are possible + + Args: + required_types_classes (tuple): tuple of classes that are required + these should be ordered by COERCION_INDEX_BY_TYPE + from_server (bool): a boolean of whether the data is from the server + if false, the data is from the client + current_item (any): the current item to be converted + + Keyword Args: + must_convert (bool): if True the item to convert is of the wrong + type and we want a big list of coercibles + if False, we want a limited list of coercibles + + Returns: + (list): the remaining coercible required types, classes only + """ + current_type_simple = get_simple_class(current_item) + + results_classes = [] + for required_type_class in required_types_classes: + # convert our models to OpenApiModel + required_type_class_simplified = required_type_class + if isinstance(required_type_class_simplified, type): + if issubclass(required_type_class_simplified, ModelNormal): + required_type_class_simplified = ModelNormal + elif issubclass(required_type_class_simplified, ModelSimple): + required_type_class_simplified = ModelSimple + + if required_type_class_simplified == current_type_simple: + # don't consider converting to one's own class + continue + + class_pair = (current_type_simple, required_type_class_simplified) + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: + results_classes.append(required_type_class) + elif class_pair in UPCONVERSION_TYPE_PAIRS: + results_classes.append(required_type_class) + return results_classes + + +def get_required_type_classes(required_types_mixed): + """Converts the tuple required_types into a tuple and a dict described + below + + Args: + required_types_mixed (tuple/list): will contain either classes or + instance of list or dict + + Returns: + (valid_classes, dict_valid_class_to_child_types_mixed): + valid_classes (tuple): the valid classes that the current item + should be + dict_valid_class_to_child_types_mixed (doct): + valid_class (class): this is the key + child_types_mixed (list/dict/tuple): describes the valid child + types + """ + valid_classes = [] + child_req_types_by_current_type = {} + for required_type in required_types_mixed: + if isinstance(required_type, list): + valid_classes.append(list) + child_req_types_by_current_type[list] = required_type + elif isinstance(required_type, tuple): + valid_classes.append(tuple) + child_req_types_by_current_type[tuple] = required_type + elif isinstance(required_type, dict): + valid_classes.append(dict) + child_req_types_by_current_type[dict] = required_type[str] + else: + valid_classes.append(required_type) + return tuple(valid_classes), child_req_types_by_current_type + + +def change_keys_js_to_python(input_dict, model_class): + """ + Converts from javascript_key keys in the input_dict to python_keys in + the output dict using the mapping in model_class + """ + + output_dict = {} + reversed_attr_map = {value: key for key, value in + six.iteritems(model_class.attribute_map)} + for javascript_key, value in six.iteritems(input_dict): + python_key = reversed_attr_map.get(javascript_key) + if python_key is None: + # if the key is unknown, it is in error or it is an + # additionalProperties variable + python_key = javascript_key + output_dict[python_key] = value + return output_dict + + +def get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type + ) + + +def deserialize_primitive(data, klass, path_to_item): + """Deserializes string to primitive type. + + :param data: str/int/float + :param klass: str/class the class to convert to + + :return: int, float, str, bool, date, datetime + """ + additional_message = "" + try: + if klass in {datetime, date}: + additional_message = ( + "If you need your parameter to have a fallback " + "string value, please set its type as `type: {}` in your " + "spec. That allows the value to be any type. " + ) + if klass == datetime: + if len(data) < 8: + raise ValueError("This is not a datetime") + # The string should be in iso8601 datetime format. + parsed_datetime = parse(data) + date_only = ( + parsed_datetime.hour == 0 and + parsed_datetime.minute == 0 and + parsed_datetime.second == 0 and + parsed_datetime.tzinfo is None and + 8 <= len(data) <= 10 + ) + if date_only: + raise ValueError("This is a date, not a datetime") + return parsed_datetime + elif klass == date: + if len(data) < 8: + raise ValueError("This is not a date") + return parse(data).date() + else: + converted_value = klass(data) + if isinstance(data, str) and klass == float: + if str(converted_value) != data: + # '7' -> 7.0 -> '7.0' != '7' + raise ValueError('This is not a float') + return converted_value + except (OverflowError, ValueError): + # parse can raise OverflowError + raise ApiValueError( + "{0}Failed to parse {1} as {2}".format( + additional_message, repr(data), get_py3_class_name(klass) + ), + path_to_item=path_to_item + ) + + +def deserialize_model(model_data, model_class, path_to_item, check_type, + configuration, from_server): + """Deserializes model_data to model instance. + + Args: + model_data (list/dict): data to instantiate the model + model_class (OpenApiModel): the model class + path_to_item (list): path to the model in the received data + check_type (bool): whether to check the data tupe for the values in + the model + configuration (Configuration): the instance to use to convert files + from_server (bool): True if the data is from the server + False if the data is from the client + + Returns: + model instance + + Raise: + ApiTypeError + ApiValueError + ApiKeyError + """ + fixed_model_data = copy.deepcopy(model_data) + + if isinstance(fixed_model_data, dict): + fixed_model_data = change_keys_js_to_python(fixed_model_data, + model_class) + + kw_args = dict(_check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _from_server=from_server) + + if hasattr(model_class, 'get_real_child_model'): + # discriminator case + discriminator_class = model_class.get_real_child_model(model_data) + if discriminator_class: + if isinstance(model_data, list): + instance = discriminator_class(*model_data, **kw_args) + elif isinstance(model_data, dict): + fixed_model_data = change_keys_js_to_python( + fixed_model_data, + discriminator_class + ) + kw_args.update(fixed_model_data) + instance = discriminator_class(**kw_args) + else: + # all other cases + if isinstance(model_data, list): + instance = model_class(*model_data, **kw_args) + if isinstance(model_data, dict): + fixed_model_data = change_keys_js_to_python(fixed_model_data, + model_class) + kw_args.update(fixed_model_data) + instance = model_class(**kw_args) + else: + instance = model_class(model_data, **kw_args) + + return instance + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if six.PY3 and isinstance(response_data, str): + # in python3 change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +def attempt_convert_item(input_value, valid_classes, path_to_item, + configuration, from_server, key_type=False, + must_convert=False, check_type=True): + """ + Args: + input_value (any): the data to convert + valid_classes (any): the classes that are valid + path_to_item (list): the path to the item to convert + configuration (Configuration): the instance to use to convert files + from_server (bool): True if data is from the server, False is data is + from the client + key_type (bool): if True we need to convert a key type (not supported) + must_convert (bool): if True we must convert + check_type (bool): if True we check the type or the returned data in + ModelNormal and ModelSimple instances + + Returns: + instance (any) the fixed item + + Raises: + ApiTypeError + ApiValueError + ApiKeyError + """ + valid_classes_ordered = order_response_types(valid_classes) + valid_classes_coercible = remove_uncoercible( + valid_classes_ordered, input_value, from_server) + if not valid_classes_coercible or key_type: + # we do not handle keytype errors, json will take care + # of this for us + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=key_type) + for valid_class in valid_classes_coercible: + try: + if issubclass(valid_class, OpenApiModel): + return deserialize_model(input_value, valid_class, + path_to_item, check_type, + configuration, from_server) + elif valid_class == file_type: + return deserialize_file(input_value, configuration) + return deserialize_primitive(input_value, valid_class, + path_to_item) + except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: + if must_convert: + raise conversion_exc + # if we have conversion errors when must_convert == False + # we ignore the exception and move on to the next class + continue + # we were unable to convert, must_convert == False + return input_value + + +def validate_and_convert_types(input_value, required_types_mixed, path_to_item, + from_server, _check_type, configuration=None): + """Raises a TypeError is there is a problem, otherwise returns value + + Args: + input_value (any): the data to validate/convert + required_types_mixed (list/dict/tuple): A list of + valid classes, or a list tuples of valid classes, or a dict where + the value is a tuple of value classes + path_to_item: (list) the path to the data being validated + this stores a list of keys or indices to get to the data being + validated + from_server (bool): True if data is from the server + False if data is from the client + _check_type: (boolean) if true, type will be checked and conversion + will be attempted. + configuration: (Configuration): the configuration class to use + when converting file_type items. + If passed, conversion will be attempted when possible + If not passed, no conversions will be attempted and + exceptions will be raised + + Returns: + the correctly typed value + + Raises: + ApiTypeError + """ + results = get_required_type_classes(required_types_mixed) + valid_classes, child_req_types_by_current_type = results + + input_class_simple = get_simple_class(input_value) + valid_type = input_class_simple in set(valid_classes) + if not valid_type: + if configuration: + # if input_value is not valid_type try to convert it + converted_instance = attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=True + ) + return converted_instance + else: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=False) + + # input_value's type is in valid_classes + if len(valid_classes) > 1 and configuration: + # there are valid classes which are not the current class + valid_classes_coercible = remove_uncoercible( + valid_classes, input_value, from_server, must_convert=False) + if valid_classes_coercible: + converted_instance = attempt_convert_item( + input_value, + valid_classes_coercible, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=False + ) + return converted_instance + + if child_req_types_by_current_type == {}: + # all types are of the required types and there are no more inner + # variables left to look at + return input_value + inner_required_types = child_req_types_by_current_type.get( + type(input_value) + ) + if inner_required_types is None: + # for this type, there are not more inner variables left to look at + return input_value + if isinstance(input_value, list): + if input_value == []: + # allow an empty list + return input_value + for index, inner_value in enumerate(input_value): + inner_path = list(path_to_item) + inner_path.append(index) + input_value[index] = validate_and_convert_types( + inner_value, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + elif isinstance(input_value, dict): + if input_value == {}: + # allow an empty dict + return input_value + for inner_key, inner_val in six.iteritems(input_value): + inner_path = list(path_to_item) + inner_path.append(inner_key) + if get_simple_class(inner_key) != str: + raise get_type_error(inner_key, inner_path, valid_classes, + key_type=True) + input_value[inner_key] = validate_and_convert_types( + inner_val, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + return input_value + + +def model_to_dict(model_instance, serialize=True): + """Returns the model properties as a dict + + Args: + model_instance (one of your model instances): the model instance that + will be converted to a dict. + + Keyword Args: + serialize (bool): if True, the keys in the dict will be values from + attribute_map + """ + result = {} + + for attr, value in six.iteritems(model_instance._data_store): + if serialize: + # we use get here because additional property key names do not + # exist in attribute_map + attr = model_instance.attribute_map.get(attr, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: model_to_dict(x, serialize=serialize) + if hasattr(x, '_data_store') else x, value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], + model_to_dict(item[1], serialize=serialize)) + if hasattr(item[1], '_data_store') else item, + value.items() + )) + elif hasattr(value, '_data_store'): + result[attr] = model_to_dict(value, serialize=serialize) + else: + result[attr] = value + + return result + + +def type_error_message(var_value=None, var_name=None, valid_classes=None, + key_type=None): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + """ + key_or_value = 'value' + if key_type: + key_or_value = 'key' + valid_classes_phrase = get_valid_classes_phrase(valid_classes) + msg = ( + "Invalid type for variable '{0}'. Required {1} type {2} and " + "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + ) + return msg + + +def get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed + Note: Adds the extra valid classes in python2 + """ + all_classes = list(input_classes) + if six.PY2 and str in input_classes: + all_classes.extend([str_py2, unicode_py2]) + if six.PY2 and int in input_classes: + all_classes.extend([int_py2, long_py2]) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return 'is {0}'.format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def get_py3_class_name(input_class): + if six.PY2: + if input_class == str: + return 'str' + elif input_class == int: + return 'int' + return input_class.__name__ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py new file mode 100644 index 000000000000..055355937d8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +# flake8: noqa +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +# import models into model package +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass +from petstore_api.models.animal import Animal +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly +from petstore_api.models.array_test import ArrayTest +from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat +from petstore_api.models.cat_all_of import CatAllOf +from petstore_api.models.category import Category +from petstore_api.models.class_model import ClassModel +from petstore_api.models.client import Client +from petstore_api.models.dog import Dog +from petstore_api.models.dog_all_of import DogAllOf +from petstore_api.models.enum_arrays import EnumArrays +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.enum_test import EnumTest +from petstore_api.models.file import File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.foo import Foo +from petstore_api.models.format_test import FormatTest +from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inline_object import InlineObject +from petstore_api.models.inline_object1 import InlineObject1 +from petstore_api.models.inline_object2 import InlineObject2 +from petstore_api.models.inline_object3 import InlineObject3 +from petstore_api.models.inline_object4 import InlineObject4 +from petstore_api.models.inline_object5 import InlineObject5 +from petstore_api.models.inline_response_default import InlineResponseDefault +from petstore_api.models.list import List +from petstore_api.models.map_test import MapTest +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.models.model200_response import Model200Response +from petstore_api.models.model_return import ModelReturn +from petstore_api.models.name import Name +from petstore_api.models.nullable_class import NullableClass +from petstore_api.models.number_only import NumberOnly +from petstore_api.models.order import Order +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue +from petstore_api.models.pet import Pet +from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap +from petstore_api.models.tag import Tag +from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py new file mode 100644 index 000000000000..980a953b8f83 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class AdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'map_property': 'map_property', # noqa: E501 + 'map_of_map_property': 'map_of_map_property' # noqa: E501 + } + + openapi_types = { + 'map_property': ({str: (str,)},), # noqa: E501 + 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """AdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_property ({str: (str,)}): [optional] # noqa: E501 + map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def map_property(self): + """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 + + Returns: + ({str: (str,)}): The map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('map_property') + + @map_property.setter + def map_property(self, value): + """Sets the map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('map_property', value) + + @property + def map_of_map_property(self): + """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + + Returns: + ({str: ({str: (str,)},)}): The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('map_of_map_property') + + @map_of_map_property.setter + def map_of_map_property(self, value): + """Sets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('map_of_map_property', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py new file mode 100644 index 000000000000..d625389dd634 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.cat import Cat +from petstore_api.models.dog import Dog + + +class Animal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color' # noqa: E501 + } + + discriminator_value_class_map = { + 'Dog': Dog, + 'Cat': Cat + } + + openapi_types = { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = 'class_name' + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('class_name', class_name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def class_name(self): + """Gets the class_name of this Animal. # noqa: E501 + + Returns: + (str): The class_name of this Animal. # noqa: E501 + """ + return self.__get_item('class_name') + + @class_name.setter + def class_name(self, value): + """Sets the class_name of this Animal. # noqa: E501 + """ + return self.__set_item('class_name', value) + + @property + def color(self): + """Gets the color of this Animal. # noqa: E501 + + Returns: + (str): The color of this Animal. # noqa: E501 + """ + return self.__get_item('color') + + @color.setter + def color(self, value): + """Sets the color of this Animal. # noqa: E501 + """ + return self.__set_item('color', value) + + @classmethod + def get_real_child_model(cls, data): + """Returns the real base class specified by the discriminator + We assume that data has javascript keys + """ + discriminator_key = cls.attribute_map[cls.discriminator] + discriminator_value = data[discriminator_key] + return cls.discriminator_value_class_map.get(discriminator_value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Animal): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py new file mode 100644 index 000000000000..40713b75479a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ApiResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'code': 'code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'message': 'message' # noqa: E501 + } + + openapi_types = { + 'code': (int,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ApiResponse - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def code(self): + """Gets the code of this ApiResponse. # noqa: E501 + + Returns: + (int): The code of this ApiResponse. # noqa: E501 + """ + return self.__get_item('code') + + @code.setter + def code(self, value): + """Sets the code of this ApiResponse. # noqa: E501 + """ + return self.__set_item('code', value) + + @property + def type(self): + """Gets the type of this ApiResponse. # noqa: E501 + + Returns: + (str): The type of this ApiResponse. # noqa: E501 + """ + return self.__get_item('type') + + @type.setter + def type(self, value): + """Sets the type of this ApiResponse. # noqa: E501 + """ + return self.__set_item('type', value) + + @property + def message(self): + """Gets the message of this ApiResponse. # noqa: E501 + + Returns: + (str): The message of this ApiResponse. # noqa: E501 + """ + return self.__get_item('message') + + @message.setter + def message(self, value): + """Sets the message of this ApiResponse. # noqa: E501 + """ + return self.__set_item('message', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponse): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py new file mode 100644 index 000000000000..a2e3c7326a68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ArrayOfArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber' # noqa: E501 + } + + openapi_types = { + 'array_array_number': ([[float]],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_array_number ([[float]]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def array_array_number(self): + """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + + Returns: + ([[float]]): The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + """ + return self.__get_item('array_array_number') + + @array_array_number.setter + def array_array_number(self, value): + """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + """ + return self.__set_item('array_array_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py new file mode 100644 index 000000000000..c35c8e59631c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'array_number': 'ArrayNumber' # noqa: E501 + } + + openapi_types = { + 'array_number': ([float],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_number ([float]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def array_number(self): + """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 + + Returns: + ([float]): The array_number of this ArrayOfNumberOnly. # noqa: E501 + """ + return self.__get_item('array_number') + + @array_number.setter + def array_number(self, value): + """Sets the array_number of this ArrayOfNumberOnly. # noqa: E501 + """ + return self.__set_item('array_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfNumberOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py new file mode 100644 index 000000000000..cc52f04d318f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.read_only_first import ReadOnlyFirst + + +class ArrayTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'array_of_string': 'array_of_string', # noqa: E501 + 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 + 'array_array_of_model': 'array_array_of_model' # noqa: E501 + } + + openapi_types = { + 'array_of_string': ([str],), # noqa: E501 + 'array_array_of_integer': ([[int]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ArrayTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_of_string ([str]): [optional] # noqa: E501 + array_array_of_integer ([[int]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def array_of_string(self): + """Gets the array_of_string of this ArrayTest. # noqa: E501 + + Returns: + ([str]): The array_of_string of this ArrayTest. # noqa: E501 + """ + return self.__get_item('array_of_string') + + @array_of_string.setter + def array_of_string(self, value): + """Sets the array_of_string of this ArrayTest. # noqa: E501 + """ + return self.__set_item('array_of_string', value) + + @property + def array_array_of_integer(self): + """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 + + Returns: + ([[int]]): The array_array_of_integer of this ArrayTest. # noqa: E501 + """ + return self.__get_item('array_array_of_integer') + + @array_array_of_integer.setter + def array_array_of_integer(self, value): + """Sets the array_array_of_integer of this ArrayTest. # noqa: E501 + """ + return self.__set_item('array_array_of_integer', value) + + @property + def array_array_of_model(self): + """Gets the array_array_of_model of this ArrayTest. # noqa: E501 + + Returns: + ([[ReadOnlyFirst]]): The array_array_of_model of this ArrayTest. # noqa: E501 + """ + return self.__get_item('array_array_of_model') + + @array_array_of_model.setter + def array_array_of_model(self, value): + """Sets the array_array_of_model of this ArrayTest. # noqa: E501 + """ + return self.__set_item('array_array_of_model', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py new file mode 100644 index 000000000000..9134f5e4251f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Capitalization(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'small_camel': 'smallCamel', # noqa: E501 + 'capital_camel': 'CapitalCamel', # noqa: E501 + 'small_snake': 'small_Snake', # noqa: E501 + 'capital_snake': 'Capital_Snake', # noqa: E501 + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 + 'att_name': 'ATT_NAME' # noqa: E501 + } + + openapi_types = { + 'small_camel': (str,), # noqa: E501 + 'capital_camel': (str,), # noqa: E501 + 'small_snake': (str,), # noqa: E501 + 'capital_snake': (str,), # noqa: E501 + 'sca_eth_flow_points': (str,), # noqa: E501 + 'att_name': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Capitalization - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def small_camel(self): + """Gets the small_camel of this Capitalization. # noqa: E501 + + Returns: + (str): The small_camel of this Capitalization. # noqa: E501 + """ + return self.__get_item('small_camel') + + @small_camel.setter + def small_camel(self, value): + """Sets the small_camel of this Capitalization. # noqa: E501 + """ + return self.__set_item('small_camel', value) + + @property + def capital_camel(self): + """Gets the capital_camel of this Capitalization. # noqa: E501 + + Returns: + (str): The capital_camel of this Capitalization. # noqa: E501 + """ + return self.__get_item('capital_camel') + + @capital_camel.setter + def capital_camel(self, value): + """Sets the capital_camel of this Capitalization. # noqa: E501 + """ + return self.__set_item('capital_camel', value) + + @property + def small_snake(self): + """Gets the small_snake of this Capitalization. # noqa: E501 + + Returns: + (str): The small_snake of this Capitalization. # noqa: E501 + """ + return self.__get_item('small_snake') + + @small_snake.setter + def small_snake(self, value): + """Sets the small_snake of this Capitalization. # noqa: E501 + """ + return self.__set_item('small_snake', value) + + @property + def capital_snake(self): + """Gets the capital_snake of this Capitalization. # noqa: E501 + + Returns: + (str): The capital_snake of this Capitalization. # noqa: E501 + """ + return self.__get_item('capital_snake') + + @capital_snake.setter + def capital_snake(self, value): + """Sets the capital_snake of this Capitalization. # noqa: E501 + """ + return self.__set_item('capital_snake', value) + + @property + def sca_eth_flow_points(self): + """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 + + Returns: + (str): The sca_eth_flow_points of this Capitalization. # noqa: E501 + """ + return self.__get_item('sca_eth_flow_points') + + @sca_eth_flow_points.setter + def sca_eth_flow_points(self, value): + """Sets the sca_eth_flow_points of this Capitalization. # noqa: E501 + """ + return self.__set_item('sca_eth_flow_points', value) + + @property + def att_name(self): + """Gets the att_name of this Capitalization. # noqa: E501 + Name of the pet # noqa: E501 + + Returns: + (str): The att_name of this Capitalization. # noqa: E501 + """ + return self.__get_item('att_name') + + @att_name.setter + def att_name(self, value): + """Sets the att_name of this Capitalization. # noqa: E501 + Name of the pet # noqa: E501 + """ + return self.__set_item('att_name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Capitalization): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py new file mode 100644 index 000000000000..40508dd3ce79 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Cat(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + 'declawed': 'declawed' # noqa: E501 + } + + openapi_types = { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'declawed': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Cat - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('class_name', class_name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def class_name(self): + """Gets the class_name of this Cat. # noqa: E501 + + Returns: + (str): The class_name of this Cat. # noqa: E501 + """ + return self.__get_item('class_name') + + @class_name.setter + def class_name(self, value): + """Sets the class_name of this Cat. # noqa: E501 + """ + return self.__set_item('class_name', value) + + @property + def color(self): + """Gets the color of this Cat. # noqa: E501 + + Returns: + (str): The color of this Cat. # noqa: E501 + """ + return self.__get_item('color') + + @color.setter + def color(self, value): + """Sets the color of this Cat. # noqa: E501 + """ + return self.__set_item('color', value) + + @property + def declawed(self): + """Gets the declawed of this Cat. # noqa: E501 + + Returns: + (bool): The declawed of this Cat. # noqa: E501 + """ + return self.__get_item('declawed') + + @declawed.setter + def declawed(self, value): + """Sets the declawed of this Cat. # noqa: E501 + """ + return self.__set_item('declawed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Cat): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py new file mode 100644 index 000000000000..cb1f0d815a0f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class CatAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'declawed': 'declawed' # noqa: E501 + } + + openapi_types = { + 'declawed': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """CatAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def declawed(self): + """Gets the declawed of this CatAllOf. # noqa: E501 + + Returns: + (bool): The declawed of this CatAllOf. # noqa: E501 + """ + return self.__get_item('declawed') + + @declawed.setter + def declawed(self, value): + """Sets the declawed of this CatAllOf. # noqa: E501 + """ + return self.__set_item('declawed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CatAllOf): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py new file mode 100644 index 000000000000..ca367ad9c3d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Category(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, name='default-name', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('name', name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Category. # noqa: E501 + + Returns: + (int): The id of this Category. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Category. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def name(self): + """Gets the name of this Category. # noqa: E501 + + Returns: + (str): The name of this Category. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Category. # noqa: E501 + """ + return self.__set_item('name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Category): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py new file mode 100644 index 000000000000..b44cdb80aae0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ClassModel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + '_class': '_class' # noqa: E501 + } + + openapi_types = { + '_class': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ClassModel - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _class (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def _class(self): + """Gets the _class of this ClassModel. # noqa: E501 + + Returns: + (str): The _class of this ClassModel. # noqa: E501 + """ + return self.__get_item('_class') + + @_class.setter + def _class(self, value): + """Sets the _class of this ClassModel. # noqa: E501 + """ + return self.__set_item('_class', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClassModel): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py new file mode 100644 index 000000000000..5e1699a2196b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Client(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'client': 'client' # noqa: E501 + } + + openapi_types = { + 'client': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Client - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + client (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def client(self): + """Gets the client of this Client. # noqa: E501 + + Returns: + (str): The client of this Client. # noqa: E501 + """ + return self.__get_item('client') + + @client.setter + def client(self, value): + """Sets the client of this Client. # noqa: E501 + """ + return self.__set_item('client', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Client): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py new file mode 100644 index 000000000000..bac013b867d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Dog(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + 'breed': 'breed' # noqa: E501 + } + + openapi_types = { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'breed': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Dog - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('class_name', class_name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def class_name(self): + """Gets the class_name of this Dog. # noqa: E501 + + Returns: + (str): The class_name of this Dog. # noqa: E501 + """ + return self.__get_item('class_name') + + @class_name.setter + def class_name(self, value): + """Sets the class_name of this Dog. # noqa: E501 + """ + return self.__set_item('class_name', value) + + @property + def color(self): + """Gets the color of this Dog. # noqa: E501 + + Returns: + (str): The color of this Dog. # noqa: E501 + """ + return self.__get_item('color') + + @color.setter + def color(self, value): + """Sets the color of this Dog. # noqa: E501 + """ + return self.__set_item('color', value) + + @property + def breed(self): + """Gets the breed of this Dog. # noqa: E501 + + Returns: + (str): The breed of this Dog. # noqa: E501 + """ + return self.__get_item('breed') + + @breed.setter + def breed(self, value): + """Sets the breed of this Dog. # noqa: E501 + """ + return self.__set_item('breed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Dog): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py new file mode 100644 index 000000000000..7d9a33bbe365 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class DogAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'breed': 'breed' # noqa: E501 + } + + openapi_types = { + 'breed': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """DogAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def breed(self): + """Gets the breed of this DogAllOf. # noqa: E501 + + Returns: + (str): The breed of this DogAllOf. # noqa: E501 + """ + return self.__get_item('breed') + + @breed.setter + def breed(self, value): + """Sets the breed of this DogAllOf. # noqa: E501 + """ + return self.__set_item('breed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DogAllOf): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py new file mode 100644 index 000000000000..477193e858f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -0,0 +1,260 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class EnumArrays(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('just_symbol',): { + '>=': ">=", + '$': "$", + }, + ('array_enum',): { + 'FISH': "fish", + 'CRAB': "crab", + }, + } + + attribute_map = { + 'just_symbol': 'just_symbol', # noqa: E501 + 'array_enum': 'array_enum' # noqa: E501 + } + + openapi_types = { + 'just_symbol': (str,), # noqa: E501 + 'array_enum': ([str],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """EnumArrays - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_symbol (str): [optional] # noqa: E501 + array_enum ([str]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def just_symbol(self): + """Gets the just_symbol of this EnumArrays. # noqa: E501 + + Returns: + (str): The just_symbol of this EnumArrays. # noqa: E501 + """ + return self.__get_item('just_symbol') + + @just_symbol.setter + def just_symbol(self, value): + """Sets the just_symbol of this EnumArrays. # noqa: E501 + """ + return self.__set_item('just_symbol', value) + + @property + def array_enum(self): + """Gets the array_enum of this EnumArrays. # noqa: E501 + + Returns: + ([str]): The array_enum of this EnumArrays. # noqa: E501 + """ + return self.__get_item('array_enum') + + @array_enum.setter + def array_enum(self, value): + """Sets the array_enum of this EnumArrays. # noqa: E501 + """ + return self.__set_item('array_enum', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumArrays): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py new file mode 100644 index 000000000000..0b3bca10a53e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class EnumClass(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + openapi_types = { + 'value': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """EnumClass - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to '-efg', must be one of ['-efg'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this EnumClass. # noqa: E501 + + Returns: + (str): The value of this EnumClass. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this EnumClass. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumClass): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py new file mode 100644 index 000000000000..b2db47a8573d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -0,0 +1,384 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue + + +class EnumTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_string_required',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_integer',): { + '1': 1, + '-1': -1, + }, + ('enum_number',): { + '1.1': 1.1, + '-1.2': -1.2, + }, + } + + attribute_map = { + 'enum_string': 'enum_string', # noqa: E501 + 'enum_string_required': 'enum_string_required', # noqa: E501 + 'enum_integer': 'enum_integer', # noqa: E501 + 'enum_number': 'enum_number', # noqa: E501 + 'outer_enum': 'outerEnum', # noqa: E501 + 'outer_enum_integer': 'outerEnumInteger', # noqa: E501 + 'outer_enum_default_value': 'outerEnumDefaultValue', # noqa: E501 + 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue' # noqa: E501 + } + + openapi_types = { + 'enum_string': (str,), # noqa: E501 + 'enum_string_required': (str,), # noqa: E501 + 'enum_integer': (int,), # noqa: E501 + 'enum_number': (float,), # noqa: E501 + 'outer_enum': (OuterEnum,), # noqa: E501 + 'outer_enum_integer': (OuterEnumInteger,), # noqa: E501 + 'outer_enum_default_value': (OuterEnumDefaultValue,), # noqa: E501 + 'outer_enum_integer_default_value': (OuterEnumIntegerDefaultValue,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, enum_string_required, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + outer_enum (OuterEnum): [optional] # noqa: E501 + outer_enum_integer (OuterEnumInteger): [optional] # noqa: E501 + outer_enum_default_value (OuterEnumDefaultValue): [optional] # noqa: E501 + outer_enum_integer_default_value (OuterEnumIntegerDefaultValue): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('enum_string_required', enum_string_required) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def enum_string(self): + """Gets the enum_string of this EnumTest. # noqa: E501 + + Returns: + (str): The enum_string of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_string') + + @enum_string.setter + def enum_string(self, value): + """Sets the enum_string of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_string', value) + + @property + def enum_string_required(self): + """Gets the enum_string_required of this EnumTest. # noqa: E501 + + Returns: + (str): The enum_string_required of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_string_required') + + @enum_string_required.setter + def enum_string_required(self, value): + """Sets the enum_string_required of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_string_required', value) + + @property + def enum_integer(self): + """Gets the enum_integer of this EnumTest. # noqa: E501 + + Returns: + (int): The enum_integer of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_integer') + + @enum_integer.setter + def enum_integer(self, value): + """Sets the enum_integer of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_integer', value) + + @property + def enum_number(self): + """Gets the enum_number of this EnumTest. # noqa: E501 + + Returns: + (float): The enum_number of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_number') + + @enum_number.setter + def enum_number(self, value): + """Sets the enum_number of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_number', value) + + @property + def outer_enum(self): + """Gets the outer_enum of this EnumTest. # noqa: E501 + + Returns: + (OuterEnum): The outer_enum of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum') + + @outer_enum.setter + def outer_enum(self, value): + """Sets the outer_enum of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum', value) + + @property + def outer_enum_integer(self): + """Gets the outer_enum_integer of this EnumTest. # noqa: E501 + + Returns: + (OuterEnumInteger): The outer_enum_integer of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum_integer') + + @outer_enum_integer.setter + def outer_enum_integer(self, value): + """Sets the outer_enum_integer of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum_integer', value) + + @property + def outer_enum_default_value(self): + """Gets the outer_enum_default_value of this EnumTest. # noqa: E501 + + Returns: + (OuterEnumDefaultValue): The outer_enum_default_value of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum_default_value') + + @outer_enum_default_value.setter + def outer_enum_default_value(self, value): + """Sets the outer_enum_default_value of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum_default_value', value) + + @property + def outer_enum_integer_default_value(self): + """Gets the outer_enum_integer_default_value of this EnumTest. # noqa: E501 + + Returns: + (OuterEnumIntegerDefaultValue): The outer_enum_integer_default_value of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum_integer_default_value') + + @outer_enum_integer_default_value.setter + def outer_enum_integer_default_value(self, value): + """Sets the outer_enum_integer_default_value of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum_integer_default_value', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py new file mode 100644 index 000000000000..7da4e025a205 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py @@ -0,0 +1,236 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class File(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'source_uri': 'sourceURI' # noqa: E501 + } + + openapi_types = { + 'source_uri': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """File - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def source_uri(self): + """Gets the source_uri of this File. # noqa: E501 + Test capitalization # noqa: E501 + + Returns: + (str): The source_uri of this File. # noqa: E501 + """ + return self.__get_item('source_uri') + + @source_uri.setter + def source_uri(self, value): + """Sets the source_uri of this File. # noqa: E501 + Test capitalization # noqa: E501 + """ + return self.__set_item('source_uri', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, File): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py new file mode 100644 index 000000000000..5e0ca0498d9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.file import File + + +class FileSchemaTestClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'file': 'file', # noqa: E501 + 'files': 'files' # noqa: E501 + } + + openapi_types = { + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def file(self): + """Gets the file of this FileSchemaTestClass. # noqa: E501 + + Returns: + (File): The file of this FileSchemaTestClass. # noqa: E501 + """ + return self.__get_item('file') + + @file.setter + def file(self, value): + """Sets the file of this FileSchemaTestClass. # noqa: E501 + """ + return self.__set_item('file', value) + + @property + def files(self): + """Gets the files of this FileSchemaTestClass. # noqa: E501 + + Returns: + ([File]): The files of this FileSchemaTestClass. # noqa: E501 + """ + return self.__get_item('files') + + @files.setter + def files(self, value): + """Sets the files of this FileSchemaTestClass. # noqa: E501 + """ + return self.__set_item('files', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FileSchemaTestClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py new file mode 100644 index 000000000000..60997bcf82d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Foo(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'bar': 'bar' # noqa: E501 + } + + openapi_types = { + 'bar': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Foo - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] if omitted the server will use the default value of 'bar' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def bar(self): + """Gets the bar of this Foo. # noqa: E501 + + Returns: + (str): The bar of this Foo. # noqa: E501 + """ + return self.__get_item('bar') + + @bar.setter + def bar(self, value): + """Sets the bar of this Foo. # noqa: E501 + """ + return self.__set_item('bar', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Foo): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py new file mode 100644 index 000000000000..85304db27f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -0,0 +1,536 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class FormatTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'number': 'number', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date': 'date', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'uuid': 'uuid', # noqa: E501 + 'password': 'password', # noqa: E501 + 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 + 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter' # noqa: E501 + } + + openapi_types = { + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'number': (float,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'uuid': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'pattern_with_digits': (str,), # noqa: E501 + 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 + } + + validations = { + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('float',): { + 'inclusive_maximum': 987.6, + 'inclusive_minimum': 54.3, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + ('pattern_with_digits',): { + 'regex': { + 'pattern': r'^\d{10}$', # noqa: E501 + }, + }, + ('pattern_with_digits_and_delimiter',): { + 'regex': { + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, number, byte, date, password, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file_type): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 + pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('number', number) + self.__set_item('byte', byte) + self.__set_item('date', date) + self.__set_item('password', password) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def integer(self): + """Gets the integer of this FormatTest. # noqa: E501 + + Returns: + (int): The integer of this FormatTest. # noqa: E501 + """ + return self.__get_item('integer') + + @integer.setter + def integer(self, value): + """Sets the integer of this FormatTest. # noqa: E501 + """ + return self.__set_item('integer', value) + + @property + def int32(self): + """Gets the int32 of this FormatTest. # noqa: E501 + + Returns: + (int): The int32 of this FormatTest. # noqa: E501 + """ + return self.__get_item('int32') + + @int32.setter + def int32(self, value): + """Sets the int32 of this FormatTest. # noqa: E501 + """ + return self.__set_item('int32', value) + + @property + def int64(self): + """Gets the int64 of this FormatTest. # noqa: E501 + + Returns: + (int): The int64 of this FormatTest. # noqa: E501 + """ + return self.__get_item('int64') + + @int64.setter + def int64(self, value): + """Sets the int64 of this FormatTest. # noqa: E501 + """ + return self.__set_item('int64', value) + + @property + def number(self): + """Gets the number of this FormatTest. # noqa: E501 + + Returns: + (float): The number of this FormatTest. # noqa: E501 + """ + return self.__get_item('number') + + @number.setter + def number(self, value): + """Sets the number of this FormatTest. # noqa: E501 + """ + return self.__set_item('number', value) + + @property + def float(self): + """Gets the float of this FormatTest. # noqa: E501 + + Returns: + (float): The float of this FormatTest. # noqa: E501 + """ + return self.__get_item('float') + + @float.setter + def float(self, value): + """Sets the float of this FormatTest. # noqa: E501 + """ + return self.__set_item('float', value) + + @property + def double(self): + """Gets the double of this FormatTest. # noqa: E501 + + Returns: + (float): The double of this FormatTest. # noqa: E501 + """ + return self.__get_item('double') + + @double.setter + def double(self, value): + """Sets the double of this FormatTest. # noqa: E501 + """ + return self.__set_item('double', value) + + @property + def string(self): + """Gets the string of this FormatTest. # noqa: E501 + + Returns: + (str): The string of this FormatTest. # noqa: E501 + """ + return self.__get_item('string') + + @string.setter + def string(self, value): + """Sets the string of this FormatTest. # noqa: E501 + """ + return self.__set_item('string', value) + + @property + def byte(self): + """Gets the byte of this FormatTest. # noqa: E501 + + Returns: + (str): The byte of this FormatTest. # noqa: E501 + """ + return self.__get_item('byte') + + @byte.setter + def byte(self, value): + """Sets the byte of this FormatTest. # noqa: E501 + """ + return self.__set_item('byte', value) + + @property + def binary(self): + """Gets the binary of this FormatTest. # noqa: E501 + + Returns: + (file_type): The binary of this FormatTest. # noqa: E501 + """ + return self.__get_item('binary') + + @binary.setter + def binary(self, value): + """Sets the binary of this FormatTest. # noqa: E501 + """ + return self.__set_item('binary', value) + + @property + def date(self): + """Gets the date of this FormatTest. # noqa: E501 + + Returns: + (date): The date of this FormatTest. # noqa: E501 + """ + return self.__get_item('date') + + @date.setter + def date(self, value): + """Sets the date of this FormatTest. # noqa: E501 + """ + return self.__set_item('date', value) + + @property + def date_time(self): + """Gets the date_time of this FormatTest. # noqa: E501 + + Returns: + (datetime): The date_time of this FormatTest. # noqa: E501 + """ + return self.__get_item('date_time') + + @date_time.setter + def date_time(self, value): + """Sets the date_time of this FormatTest. # noqa: E501 + """ + return self.__set_item('date_time', value) + + @property + def uuid(self): + """Gets the uuid of this FormatTest. # noqa: E501 + + Returns: + (str): The uuid of this FormatTest. # noqa: E501 + """ + return self.__get_item('uuid') + + @uuid.setter + def uuid(self, value): + """Sets the uuid of this FormatTest. # noqa: E501 + """ + return self.__set_item('uuid', value) + + @property + def password(self): + """Gets the password of this FormatTest. # noqa: E501 + + Returns: + (str): The password of this FormatTest. # noqa: E501 + """ + return self.__get_item('password') + + @password.setter + def password(self, value): + """Sets the password of this FormatTest. # noqa: E501 + """ + return self.__set_item('password', value) + + @property + def pattern_with_digits(self): + """Gets the pattern_with_digits of this FormatTest. # noqa: E501 + A string that is a 10 digit number. Can have leading zeros. # noqa: E501 + + Returns: + (str): The pattern_with_digits of this FormatTest. # noqa: E501 + """ + return self.__get_item('pattern_with_digits') + + @pattern_with_digits.setter + def pattern_with_digits(self, value): + """Sets the pattern_with_digits of this FormatTest. # noqa: E501 + A string that is a 10 digit number. Can have leading zeros. # noqa: E501 + """ + return self.__set_item('pattern_with_digits', value) + + @property + def pattern_with_digits_and_delimiter(self): + """Gets the pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 + A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 + + Returns: + (str): The pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 + """ + return self.__get_item('pattern_with_digits_and_delimiter') + + @pattern_with_digits_and_delimiter.setter + def pattern_with_digits_and_delimiter(self, value): + """Sets the pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 + A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 + """ + return self.__set_item('pattern_with_digits_and_delimiter', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FormatTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py new file mode 100644 index 000000000000..ecf201d21e81 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class HasOnlyReadOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'foo': 'foo' # noqa: E501 + } + + openapi_types = { + 'bar': (str,), # noqa: E501 + 'foo': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def bar(self): + """Gets the bar of this HasOnlyReadOnly. # noqa: E501 + + Returns: + (str): The bar of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__get_item('bar') + + @bar.setter + def bar(self, value): + """Sets the bar of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__set_item('bar', value) + + @property + def foo(self): + """Gets the foo of this HasOnlyReadOnly. # noqa: E501 + + Returns: + (str): The foo of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__get_item('foo') + + @foo.setter + def foo(self, value): + """Sets the foo of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__set_item('foo', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HasOnlyReadOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py new file mode 100644 index 000000000000..9da7bc6f3939 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class HealthCheckResult(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'nullable_message': 'NullableMessage' # noqa: E501 + } + + openapi_types = { + 'nullable_message': (str, none_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """HealthCheckResult - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + nullable_message (str, none_type): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def nullable_message(self): + """Gets the nullable_message of this HealthCheckResult. # noqa: E501 + + Returns: + (str, none_type): The nullable_message of this HealthCheckResult. # noqa: E501 + """ + return self.__get_item('nullable_message') + + @nullable_message.setter + def nullable_message(self, value): + """Sets the nullable_message of this HealthCheckResult. # noqa: E501 + """ + return self.__set_item('nullable_message', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HealthCheckResult): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py new file mode 100644 index 000000000000..f91a27142a47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'name': 'name', # noqa: E501 + 'status': 'status' # noqa: E501 + } + + openapi_types = { + 'name': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (str): Updated name of the pet. [optional] # noqa: E501 + status (str): Updated status of the pet. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def name(self): + """Gets the name of this InlineObject. # noqa: E501 + Updated name of the pet # noqa: E501 + + Returns: + (str): The name of this InlineObject. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this InlineObject. # noqa: E501 + Updated name of the pet # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def status(self): + """Gets the status of this InlineObject. # noqa: E501 + Updated status of the pet # noqa: E501 + + Returns: + (str): The status of this InlineObject. # noqa: E501 + """ + return self.__get_item('status') + + @status.setter + def status(self, value): + """Sets the status of this InlineObject. # noqa: E501 + Updated status of the pet # noqa: E501 + """ + return self.__set_item('status', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py new file mode 100644 index 000000000000..85fe82650f34 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject1(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'additional_metadata': 'additionalMetadata', # noqa: E501 + 'file': 'file' # noqa: E501 + } + + openapi_types = { + 'additional_metadata': (str,), # noqa: E501 + 'file': (file_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject1 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + file (file_type): file to upload. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def additional_metadata(self): + """Gets the additional_metadata of this InlineObject1. # noqa: E501 + Additional data to pass to server # noqa: E501 + + Returns: + (str): The additional_metadata of this InlineObject1. # noqa: E501 + """ + return self.__get_item('additional_metadata') + + @additional_metadata.setter + def additional_metadata(self, value): + """Sets the additional_metadata of this InlineObject1. # noqa: E501 + Additional data to pass to server # noqa: E501 + """ + return self.__set_item('additional_metadata', value) + + @property + def file(self): + """Gets the file of this InlineObject1. # noqa: E501 + file to upload # noqa: E501 + + Returns: + (file_type): The file of this InlineObject1. # noqa: E501 + """ + return self.__get_item('file') + + @file.setter + def file(self, value): + """Sets the file of this InlineObject1. # noqa: E501 + file to upload # noqa: E501 + """ + return self.__set_item('file', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject1): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py new file mode 100644 index 000000000000..30513dbafe98 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py @@ -0,0 +1,265 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject2(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_form_string_array',): { + '>': ">", + '$': "$", + }, + ('enum_form_string',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + attribute_map = { + 'enum_form_string_array': 'enum_form_string_array', # noqa: E501 + 'enum_form_string': 'enum_form_string' # noqa: E501 + } + + openapi_types = { + 'enum_form_string_array': ([str],), # noqa: E501 + 'enum_form_string': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject2 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] # noqa: E501 + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def enum_form_string_array(self): + """Gets the enum_form_string_array of this InlineObject2. # noqa: E501 + Form parameter enum test (string array) # noqa: E501 + + Returns: + ([str]): The enum_form_string_array of this InlineObject2. # noqa: E501 + """ + return self.__get_item('enum_form_string_array') + + @enum_form_string_array.setter + def enum_form_string_array(self, value): + """Sets the enum_form_string_array of this InlineObject2. # noqa: E501 + Form parameter enum test (string array) # noqa: E501 + """ + return self.__set_item('enum_form_string_array', value) + + @property + def enum_form_string(self): + """Gets the enum_form_string of this InlineObject2. # noqa: E501 + Form parameter enum test (string) # noqa: E501 + + Returns: + (str): The enum_form_string of this InlineObject2. # noqa: E501 + """ + return self.__get_item('enum_form_string') + + @enum_form_string.setter + def enum_form_string(self, value): + """Sets the enum_form_string of this InlineObject2. # noqa: E501 + Form parameter enum test (string) # noqa: E501 + """ + return self.__set_item('enum_form_string', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject2): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py new file mode 100644 index 000000000000..fa2710feeb59 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py @@ -0,0 +1,535 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject3(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'number': 'number', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'pattern_without_delimiter': 'pattern_without_delimiter', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date': 'date', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'password': 'password', # noqa: E501 + 'callback': 'callback' # noqa: E501 + } + + openapi_types = { + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'number': (float,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'pattern_without_delimiter': (str,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'callback': (str,), # noqa: E501 + } + + validations = { + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('float',): { + 'inclusive_maximum': 987.6, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('pattern_without_delimiter',): { + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, number, double, pattern_without_delimiter, byte, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject3 - a model defined in OpenAPI + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): None. [optional] # noqa: E501 + int32 (int): None. [optional] # noqa: E501 + int64 (int): None. [optional] # noqa: E501 + float (float): None. [optional] # noqa: E501 + string (str): None. [optional] # noqa: E501 + binary (file_type): None. [optional] # noqa: E501 + date (date): None. [optional] # noqa: E501 + date_time (datetime): None. [optional] # noqa: E501 + password (str): None. [optional] # noqa: E501 + callback (str): None. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('number', number) + self.__set_item('double', double) + self.__set_item('pattern_without_delimiter', pattern_without_delimiter) + self.__set_item('byte', byte) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def integer(self): + """Gets the integer of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (int): The integer of this InlineObject3. # noqa: E501 + """ + return self.__get_item('integer') + + @integer.setter + def integer(self, value): + """Sets the integer of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('integer', value) + + @property + def int32(self): + """Gets the int32 of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (int): The int32 of this InlineObject3. # noqa: E501 + """ + return self.__get_item('int32') + + @int32.setter + def int32(self, value): + """Sets the int32 of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('int32', value) + + @property + def int64(self): + """Gets the int64 of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (int): The int64 of this InlineObject3. # noqa: E501 + """ + return self.__get_item('int64') + + @int64.setter + def int64(self, value): + """Sets the int64 of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('int64', value) + + @property + def number(self): + """Gets the number of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (float): The number of this InlineObject3. # noqa: E501 + """ + return self.__get_item('number') + + @number.setter + def number(self, value): + """Sets the number of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('number', value) + + @property + def float(self): + """Gets the float of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (float): The float of this InlineObject3. # noqa: E501 + """ + return self.__get_item('float') + + @float.setter + def float(self, value): + """Sets the float of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('float', value) + + @property + def double(self): + """Gets the double of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (float): The double of this InlineObject3. # noqa: E501 + """ + return self.__get_item('double') + + @double.setter + def double(self, value): + """Sets the double of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('double', value) + + @property + def string(self): + """Gets the string of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The string of this InlineObject3. # noqa: E501 + """ + return self.__get_item('string') + + @string.setter + def string(self, value): + """Sets the string of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('string', value) + + @property + def pattern_without_delimiter(self): + """Gets the pattern_without_delimiter of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The pattern_without_delimiter of this InlineObject3. # noqa: E501 + """ + return self.__get_item('pattern_without_delimiter') + + @pattern_without_delimiter.setter + def pattern_without_delimiter(self, value): + """Sets the pattern_without_delimiter of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('pattern_without_delimiter', value) + + @property + def byte(self): + """Gets the byte of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The byte of this InlineObject3. # noqa: E501 + """ + return self.__get_item('byte') + + @byte.setter + def byte(self, value): + """Sets the byte of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('byte', value) + + @property + def binary(self): + """Gets the binary of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (file_type): The binary of this InlineObject3. # noqa: E501 + """ + return self.__get_item('binary') + + @binary.setter + def binary(self, value): + """Sets the binary of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('binary', value) + + @property + def date(self): + """Gets the date of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (date): The date of this InlineObject3. # noqa: E501 + """ + return self.__get_item('date') + + @date.setter + def date(self, value): + """Sets the date of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('date', value) + + @property + def date_time(self): + """Gets the date_time of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (datetime): The date_time of this InlineObject3. # noqa: E501 + """ + return self.__get_item('date_time') + + @date_time.setter + def date_time(self, value): + """Sets the date_time of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('date_time', value) + + @property + def password(self): + """Gets the password of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The password of this InlineObject3. # noqa: E501 + """ + return self.__get_item('password') + + @password.setter + def password(self, value): + """Sets the password of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('password', value) + + @property + def callback(self): + """Gets the callback of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The callback of this InlineObject3. # noqa: E501 + """ + return self.__get_item('callback') + + @callback.setter + def callback(self, value): + """Sets the callback of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('callback', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject3): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py new file mode 100644 index 000000000000..f77211884ada --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject4(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'param': 'param', # noqa: E501 + 'param2': 'param2' # noqa: E501 + } + + openapi_types = { + 'param': (str,), # noqa: E501 + 'param2': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject4 - a model defined in OpenAPI + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('param', param) + self.__set_item('param2', param2) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def param(self): + """Gets the param of this InlineObject4. # noqa: E501 + field1 # noqa: E501 + + Returns: + (str): The param of this InlineObject4. # noqa: E501 + """ + return self.__get_item('param') + + @param.setter + def param(self, value): + """Sets the param of this InlineObject4. # noqa: E501 + field1 # noqa: E501 + """ + return self.__set_item('param', value) + + @property + def param2(self): + """Gets the param2 of this InlineObject4. # noqa: E501 + field2 # noqa: E501 + + Returns: + (str): The param2 of this InlineObject4. # noqa: E501 + """ + return self.__get_item('param2') + + @param2.setter + def param2(self, value): + """Sets the param2 of this InlineObject4. # noqa: E501 + field2 # noqa: E501 + """ + return self.__set_item('param2', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject4): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py new file mode 100644 index 000000000000..b143ac20ee95 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py @@ -0,0 +1,258 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject5(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'additional_metadata': 'additionalMetadata', # noqa: E501 + 'required_file': 'requiredFile' # noqa: E501 + } + + openapi_types = { + 'additional_metadata': (str,), # noqa: E501 + 'required_file': (file_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, required_file, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject5 - a model defined in OpenAPI + + Args: + required_file (file_type): file to upload + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('required_file', required_file) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def additional_metadata(self): + """Gets the additional_metadata of this InlineObject5. # noqa: E501 + Additional data to pass to server # noqa: E501 + + Returns: + (str): The additional_metadata of this InlineObject5. # noqa: E501 + """ + return self.__get_item('additional_metadata') + + @additional_metadata.setter + def additional_metadata(self, value): + """Sets the additional_metadata of this InlineObject5. # noqa: E501 + Additional data to pass to server # noqa: E501 + """ + return self.__set_item('additional_metadata', value) + + @property + def required_file(self): + """Gets the required_file of this InlineObject5. # noqa: E501 + file to upload # noqa: E501 + + Returns: + (file_type): The required_file of this InlineObject5. # noqa: E501 + """ + return self.__get_item('required_file') + + @required_file.setter + def required_file(self, value): + """Sets the required_file of this InlineObject5. # noqa: E501 + file to upload # noqa: E501 + """ + return self.__set_item('required_file', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject5): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py new file mode 100644 index 000000000000..52d6240613a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.foo import Foo + + +class InlineResponseDefault(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'string': 'string' # noqa: E501 + } + + openapi_types = { + 'string': (Foo,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineResponseDefault - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + string (Foo): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def string(self): + """Gets the string of this InlineResponseDefault. # noqa: E501 + + Returns: + (Foo): The string of this InlineResponseDefault. # noqa: E501 + """ + return self.__get_item('string') + + @string.setter + def string(self, value): + """Sets the string of this InlineResponseDefault. # noqa: E501 + """ + return self.__set_item('string', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponseDefault): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py new file mode 100644 index 000000000000..79ff6c81bede --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class List(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + '_123_list': '123-list' # noqa: E501 + } + + openapi_types = { + '_123_list': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """List - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _123_list (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def _123_list(self): + """Gets the _123_list of this List. # noqa: E501 + + Returns: + (str): The _123_list of this List. # noqa: E501 + """ + return self.__get_item('_123_list') + + @_123_list.setter + def _123_list(self, value): + """Sets the _123_list of this List. # noqa: E501 + """ + return self.__set_item('_123_list', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, List): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py new file mode 100644 index 000000000000..84b07abdcc8d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -0,0 +1,293 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.string_boolean_map import StringBooleanMap + + +class MapTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('map_of_enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + }, + } + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', # noqa: E501 + 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 + 'direct_map': 'direct_map', # noqa: E501 + 'indirect_map': 'indirect_map' # noqa: E501 + } + + openapi_types = { + 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 + 'map_of_enum_string': ({str: (str,)},), # noqa: E501 + 'direct_map': ({str: (bool,)},), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """MapTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 + direct_map ({str: (bool,)}): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def map_map_of_string(self): + """Gets the map_map_of_string of this MapTest. # noqa: E501 + + Returns: + ({str: ({str: (str,)},)}): The map_map_of_string of this MapTest. # noqa: E501 + """ + return self.__get_item('map_map_of_string') + + @map_map_of_string.setter + def map_map_of_string(self, value): + """Sets the map_map_of_string of this MapTest. # noqa: E501 + """ + return self.__set_item('map_map_of_string', value) + + @property + def map_of_enum_string(self): + """Gets the map_of_enum_string of this MapTest. # noqa: E501 + + Returns: + ({str: (str,)}): The map_of_enum_string of this MapTest. # noqa: E501 + """ + return self.__get_item('map_of_enum_string') + + @map_of_enum_string.setter + def map_of_enum_string(self, value): + """Sets the map_of_enum_string of this MapTest. # noqa: E501 + """ + return self.__set_item('map_of_enum_string', value) + + @property + def direct_map(self): + """Gets the direct_map of this MapTest. # noqa: E501 + + Returns: + ({str: (bool,)}): The direct_map of this MapTest. # noqa: E501 + """ + return self.__get_item('direct_map') + + @direct_map.setter + def direct_map(self, value): + """Sets the direct_map of this MapTest. # noqa: E501 + """ + return self.__set_item('direct_map', value) + + @property + def indirect_map(self): + """Gets the indirect_map of this MapTest. # noqa: E501 + + Returns: + (StringBooleanMap): The indirect_map of this MapTest. # noqa: E501 + """ + return self.__get_item('indirect_map') + + @indirect_map.setter + def indirect_map(self, value): + """Sets the indirect_map of this MapTest. # noqa: E501 + """ + return self.__set_item('indirect_map', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MapTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..a8f9efb42974 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.animal import Animal + + +class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'uuid': 'uuid', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'map': 'map' # noqa: E501 + } + + openapi_types = { + 'uuid': (str,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def uuid(self): + """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + Returns: + (str): The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('uuid') + + @uuid.setter + def uuid(self, value): + """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('uuid', value) + + @property + def date_time(self): + """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + Returns: + (datetime): The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('date_time') + + @date_time.setter + def date_time(self, value): + """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('date_time', value) + + @property + def map(self): + """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + Returns: + ({str: (Animal,)}): The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('map') + + @map.setter + def map(self, value): + """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('map', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py new file mode 100644 index 000000000000..4bb72561e846 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Model200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'name': 'name', # noqa: E501 + '_class': 'class' # noqa: E501 + } + + openapi_types = { + 'name': (int,), # noqa: E501 + '_class': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Model200Response - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def name(self): + """Gets the name of this Model200Response. # noqa: E501 + + Returns: + (int): The name of this Model200Response. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Model200Response. # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def _class(self): + """Gets the _class of this Model200Response. # noqa: E501 + + Returns: + (str): The _class of this Model200Response. # noqa: E501 + """ + return self.__get_item('_class') + + @_class.setter + def _class(self, value): + """Sets the _class of this Model200Response. # noqa: E501 + """ + return self.__set_item('_class', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Model200Response): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py new file mode 100644 index 000000000000..1ca322750bf4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ModelReturn(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + '_return': 'return' # noqa: E501 + } + + openapi_types = { + '_return': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ModelReturn - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _return (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def _return(self): + """Gets the _return of this ModelReturn. # noqa: E501 + + Returns: + (int): The _return of this ModelReturn. # noqa: E501 + """ + return self.__get_item('_return') + + @_return.setter + def _return(self, value): + """Sets the _return of this ModelReturn. # noqa: E501 + """ + return self.__set_item('_return', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ModelReturn): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py new file mode 100644 index 000000000000..b4c205ae08c9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py @@ -0,0 +1,290 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Name(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'name': 'name', # noqa: E501 + 'snake_case': 'snake_case', # noqa: E501 + '_property': 'property', # noqa: E501 + '_123_number': '123Number' # noqa: E501 + } + + openapi_types = { + 'name': (int,), # noqa: E501 + 'snake_case': (int,), # noqa: E501 + '_property': (str,), # noqa: E501 + '_123_number': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('name', name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def name(self): + """Gets the name of this Name. # noqa: E501 + + Returns: + (int): The name of this Name. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Name. # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def snake_case(self): + """Gets the snake_case of this Name. # noqa: E501 + + Returns: + (int): The snake_case of this Name. # noqa: E501 + """ + return self.__get_item('snake_case') + + @snake_case.setter + def snake_case(self, value): + """Sets the snake_case of this Name. # noqa: E501 + """ + return self.__set_item('snake_case', value) + + @property + def _property(self): + """Gets the _property of this Name. # noqa: E501 + + Returns: + (str): The _property of this Name. # noqa: E501 + """ + return self.__get_item('_property') + + @_property.setter + def _property(self, value): + """Sets the _property of this Name. # noqa: E501 + """ + return self.__set_item('_property', value) + + @property + def _123_number(self): + """Gets the _123_number of this Name. # noqa: E501 + + Returns: + (int): The _123_number of this Name. # noqa: E501 + """ + return self.__get_item('_123_number') + + @_123_number.setter + def _123_number(self, value): + """Sets the _123_number of this Name. # noqa: E501 + """ + return self.__set_item('_123_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Name): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py new file mode 100644 index 000000000000..333baa12d124 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py @@ -0,0 +1,432 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class NullableClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'integer_prop': 'integer_prop', # noqa: E501 + 'number_prop': 'number_prop', # noqa: E501 + 'boolean_prop': 'boolean_prop', # noqa: E501 + 'string_prop': 'string_prop', # noqa: E501 + 'date_prop': 'date_prop', # noqa: E501 + 'datetime_prop': 'datetime_prop', # noqa: E501 + 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 + 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 + 'array_items_nullable': 'array_items_nullable', # noqa: E501 + 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 + 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 + 'object_items_nullable': 'object_items_nullable' # noqa: E501 + } + + openapi_types = { + 'integer_prop': (int, none_type,), # noqa: E501 + 'number_prop': (float, none_type,), # noqa: E501 + 'boolean_prop': (bool, none_type,), # noqa: E501 + 'string_prop': (str, none_type,), # noqa: E501 + 'date_prop': (date, none_type,), # noqa: E501 + 'datetime_prop': (datetime, none_type,), # noqa: E501 + 'array_nullable_prop': ([bool, date, datetime, dict, float, int, list, str], none_type,), # noqa: E501 + 'array_and_items_nullable_prop': ([bool, date, datetime, dict, float, int, list, str, none_type], none_type,), # noqa: E501 + 'array_items_nullable': ([bool, date, datetime, dict, float, int, list, str, none_type],), # noqa: E501 + 'object_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type,), # noqa: E501 + 'object_and_items_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'object_items_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + validations = { + } + + additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """NullableClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer_prop (int, none_type): [optional] # noqa: E501 + number_prop (float, none_type): [optional] # noqa: E501 + boolean_prop (bool, none_type): [optional] # noqa: E501 + string_prop (str, none_type): [optional] # noqa: E501 + date_prop (date, none_type): [optional] # noqa: E501 + datetime_prop (datetime, none_type): [optional] # noqa: E501 + array_nullable_prop ([bool, date, datetime, dict, float, int, list, str], none_type): [optional] # noqa: E501 + array_and_items_nullable_prop ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): [optional] # noqa: E501 + array_items_nullable ([bool, date, datetime, dict, float, int, list, str, none_type]): [optional] # noqa: E501 + object_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): [optional] # noqa: E501 + object_and_items_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + object_items_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def integer_prop(self): + """Gets the integer_prop of this NullableClass. # noqa: E501 + + Returns: + (int, none_type): The integer_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('integer_prop') + + @integer_prop.setter + def integer_prop(self, value): + """Sets the integer_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('integer_prop', value) + + @property + def number_prop(self): + """Gets the number_prop of this NullableClass. # noqa: E501 + + Returns: + (float, none_type): The number_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('number_prop') + + @number_prop.setter + def number_prop(self, value): + """Sets the number_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('number_prop', value) + + @property + def boolean_prop(self): + """Gets the boolean_prop of this NullableClass. # noqa: E501 + + Returns: + (bool, none_type): The boolean_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('boolean_prop') + + @boolean_prop.setter + def boolean_prop(self, value): + """Sets the boolean_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('boolean_prop', value) + + @property + def string_prop(self): + """Gets the string_prop of this NullableClass. # noqa: E501 + + Returns: + (str, none_type): The string_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('string_prop') + + @string_prop.setter + def string_prop(self, value): + """Sets the string_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('string_prop', value) + + @property + def date_prop(self): + """Gets the date_prop of this NullableClass. # noqa: E501 + + Returns: + (date, none_type): The date_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('date_prop') + + @date_prop.setter + def date_prop(self, value): + """Sets the date_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('date_prop', value) + + @property + def datetime_prop(self): + """Gets the datetime_prop of this NullableClass. # noqa: E501 + + Returns: + (datetime, none_type): The datetime_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('datetime_prop') + + @datetime_prop.setter + def datetime_prop(self, value): + """Sets the datetime_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('datetime_prop', value) + + @property + def array_nullable_prop(self): + """Gets the array_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ([bool, date, datetime, dict, float, int, list, str], none_type): The array_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('array_nullable_prop') + + @array_nullable_prop.setter + def array_nullable_prop(self, value): + """Sets the array_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('array_nullable_prop', value) + + @property + def array_and_items_nullable_prop(self): + """Gets the array_and_items_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): The array_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('array_and_items_nullable_prop') + + @array_and_items_nullable_prop.setter + def array_and_items_nullable_prop(self, value): + """Sets the array_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('array_and_items_nullable_prop', value) + + @property + def array_items_nullable(self): + """Gets the array_items_nullable of this NullableClass. # noqa: E501 + + Returns: + ([bool, date, datetime, dict, float, int, list, str, none_type]): The array_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__get_item('array_items_nullable') + + @array_items_nullable.setter + def array_items_nullable(self, value): + """Sets the array_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__set_item('array_items_nullable', value) + + @property + def object_nullable_prop(self): + """Gets the object_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): The object_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('object_nullable_prop') + + @object_nullable_prop.setter + def object_nullable_prop(self, value): + """Sets the object_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('object_nullable_prop', value) + + @property + def object_and_items_nullable_prop(self): + """Gets the object_and_items_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): The object_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('object_and_items_nullable_prop') + + @object_and_items_nullable_prop.setter + def object_and_items_nullable_prop(self, value): + """Sets the object_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('object_and_items_nullable_prop', value) + + @property + def object_items_nullable(self): + """Gets the object_items_nullable of this NullableClass. # noqa: E501 + + Returns: + ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The object_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__get_item('object_items_nullable') + + @object_items_nullable.setter + def object_items_nullable(self, value): + """Sets the object_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__set_item('object_items_nullable', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NullableClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py new file mode 100644 index 000000000000..0761b3d3e323 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class NumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'just_number': 'JustNumber' # noqa: E501 + } + + openapi_types = { + 'just_number': (float,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """NumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_number (float): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def just_number(self): + """Gets the just_number of this NumberOnly. # noqa: E501 + + Returns: + (float): The just_number of this NumberOnly. # noqa: E501 + """ + return self.__get_item('just_number') + + @just_number.setter + def just_number(self, value): + """Sets the just_number of this NumberOnly. # noqa: E501 + """ + return self.__set_item('just_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NumberOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py new file mode 100644 index 000000000000..64c84902aba5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py @@ -0,0 +1,331 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Order(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'pet_id': 'petId', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'ship_date': 'shipDate', # noqa: E501 + 'status': 'status', # noqa: E501 + 'complete': 'complete' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'pet_id': (int,), # noqa: E501 + 'quantity': (int,), # noqa: E501 + 'ship_date': (datetime,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'complete': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Order - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Order. # noqa: E501 + + Returns: + (int): The id of this Order. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Order. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def pet_id(self): + """Gets the pet_id of this Order. # noqa: E501 + + Returns: + (int): The pet_id of this Order. # noqa: E501 + """ + return self.__get_item('pet_id') + + @pet_id.setter + def pet_id(self, value): + """Sets the pet_id of this Order. # noqa: E501 + """ + return self.__set_item('pet_id', value) + + @property + def quantity(self): + """Gets the quantity of this Order. # noqa: E501 + + Returns: + (int): The quantity of this Order. # noqa: E501 + """ + return self.__get_item('quantity') + + @quantity.setter + def quantity(self, value): + """Sets the quantity of this Order. # noqa: E501 + """ + return self.__set_item('quantity', value) + + @property + def ship_date(self): + """Gets the ship_date of this Order. # noqa: E501 + + Returns: + (datetime): The ship_date of this Order. # noqa: E501 + """ + return self.__get_item('ship_date') + + @ship_date.setter + def ship_date(self, value): + """Sets the ship_date of this Order. # noqa: E501 + """ + return self.__set_item('ship_date', value) + + @property + def status(self): + """Gets the status of this Order. # noqa: E501 + Order Status # noqa: E501 + + Returns: + (str): The status of this Order. # noqa: E501 + """ + return self.__get_item('status') + + @status.setter + def status(self, value): + """Sets the status of this Order. # noqa: E501 + Order Status # noqa: E501 + """ + return self.__set_item('status', value) + + @property + def complete(self): + """Gets the complete of this Order. # noqa: E501 + + Returns: + (bool): The complete of this Order. # noqa: E501 + """ + return self.__get_item('complete') + + @complete.setter + def complete(self, value): + """Sets the complete of this Order. # noqa: E501 + """ + return self.__set_item('complete', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Order): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py new file mode 100644 index 000000000000..ac5364799dbc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterComposite(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'my_number': 'my_number', # noqa: E501 + 'my_string': 'my_string', # noqa: E501 + 'my_boolean': 'my_boolean' # noqa: E501 + } + + openapi_types = { + 'my_number': (float,), # noqa: E501 + 'my_string': (str,), # noqa: E501 + 'my_boolean': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterComposite - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + my_number (float): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def my_number(self): + """Gets the my_number of this OuterComposite. # noqa: E501 + + Returns: + (float): The my_number of this OuterComposite. # noqa: E501 + """ + return self.__get_item('my_number') + + @my_number.setter + def my_number(self, value): + """Sets the my_number of this OuterComposite. # noqa: E501 + """ + return self.__set_item('my_number', value) + + @property + def my_string(self): + """Gets the my_string of this OuterComposite. # noqa: E501 + + Returns: + (str): The my_string of this OuterComposite. # noqa: E501 + """ + return self.__get_item('my_string') + + @my_string.setter + def my_string(self, value): + """Sets the my_string of this OuterComposite. # noqa: E501 + """ + return self.__set_item('my_string', value) + + @property + def my_boolean(self): + """Gets the my_boolean of this OuterComposite. # noqa: E501 + + Returns: + (bool): The my_boolean of this OuterComposite. # noqa: E501 + """ + return self.__get_item('my_boolean') + + @my_boolean.setter + def my_boolean(self, value): + """Sets the my_boolean of this OuterComposite. # noqa: E501 + """ + return self.__set_item('my_boolean', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterComposite): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py new file mode 100644 index 000000000000..06f998d1e541 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + openapi_types = { + 'value': (str, none_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnum - a model defined in OpenAPI + + Args: + value (str, none_type): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnum. # noqa: E501 + + Returns: + (str, none_type): The value of this OuterEnum. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnum. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnum): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py new file mode 100644 index 000000000000..c867f7048565 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnumDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + openapi_types = { + 'value': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value='placed', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnumDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to 'placed', must be one of ['placed'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnumDefaultValue. # noqa: E501 + + Returns: + (str): The value of this OuterEnumDefaultValue. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnumDefaultValue. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnumDefaultValue): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py new file mode 100644 index 000000000000..b4faf008cc33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnumInteger(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + openapi_types = { + 'value': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnumInteger - a model defined in OpenAPI + + Args: + value (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnumInteger. # noqa: E501 + + Returns: + (int): The value of this OuterEnumInteger. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnumInteger. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnumInteger): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py new file mode 100644 index 000000000000..3dafc4738ec8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnumIntegerDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + openapi_types = { + 'value': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnumIntegerDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (int): defaults to 0, must be one of [0] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnumIntegerDefaultValue. # noqa: E501 + + Returns: + (int): The value of this OuterEnumIntegerDefaultValue. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnumIntegerDefaultValue. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnumIntegerDefaultValue): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py new file mode 100644 index 000000000000..3abfdfba760c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py @@ -0,0 +1,336 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.category import Category +from petstore_api.models.tag import Tag + + +class Pet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'AVAILABLE': "available", + 'PENDING': "pending", + 'SOLD': "sold", + }, + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'category': 'category', # noqa: E501 + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'status': 'status' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'photo_urls': ([str],), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('name', name) + self.__set_item('photo_urls', photo_urls) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Pet. # noqa: E501 + + Returns: + (int): The id of this Pet. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Pet. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def category(self): + """Gets the category of this Pet. # noqa: E501 + + Returns: + (Category): The category of this Pet. # noqa: E501 + """ + return self.__get_item('category') + + @category.setter + def category(self, value): + """Sets the category of this Pet. # noqa: E501 + """ + return self.__set_item('category', value) + + @property + def name(self): + """Gets the name of this Pet. # noqa: E501 + + Returns: + (str): The name of this Pet. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Pet. # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def photo_urls(self): + """Gets the photo_urls of this Pet. # noqa: E501 + + Returns: + ([str]): The photo_urls of this Pet. # noqa: E501 + """ + return self.__get_item('photo_urls') + + @photo_urls.setter + def photo_urls(self, value): + """Sets the photo_urls of this Pet. # noqa: E501 + """ + return self.__set_item('photo_urls', value) + + @property + def tags(self): + """Gets the tags of this Pet. # noqa: E501 + + Returns: + ([Tag]): The tags of this Pet. # noqa: E501 + """ + return self.__get_item('tags') + + @tags.setter + def tags(self, value): + """Sets the tags of this Pet. # noqa: E501 + """ + return self.__set_item('tags', value) + + @property + def status(self): + """Gets the status of this Pet. # noqa: E501 + pet status in the store # noqa: E501 + + Returns: + (str): The status of this Pet. # noqa: E501 + """ + return self.__get_item('status') + + @status.setter + def status(self, value): + """Sets the status of this Pet. # noqa: E501 + pet status in the store # noqa: E501 + """ + return self.__set_item('status', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Pet): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py new file mode 100644 index 000000000000..848fbccfa913 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ReadOnlyFirst(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'baz': 'baz' # noqa: E501 + } + + openapi_types = { + 'bar': (str,), # noqa: E501 + 'baz': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def bar(self): + """Gets the bar of this ReadOnlyFirst. # noqa: E501 + + Returns: + (str): The bar of this ReadOnlyFirst. # noqa: E501 + """ + return self.__get_item('bar') + + @bar.setter + def bar(self, value): + """Sets the bar of this ReadOnlyFirst. # noqa: E501 + """ + return self.__set_item('bar', value) + + @property + def baz(self): + """Gets the baz of this ReadOnlyFirst. # noqa: E501 + + Returns: + (str): The baz of this ReadOnlyFirst. # noqa: E501 + """ + return self.__get_item('baz') + + @baz.setter + def baz(self, value): + """Sets the baz of this ReadOnlyFirst. # noqa: E501 + """ + return self.__set_item('baz', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ReadOnlyFirst): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py new file mode 100644 index 000000000000..83810bdb8941 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class SpecialModelName(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'special_property_name': '$special[property.name]' # noqa: E501 + } + + openapi_types = { + 'special_property_name': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """SpecialModelName - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + special_property_name (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def special_property_name(self): + """Gets the special_property_name of this SpecialModelName. # noqa: E501 + + Returns: + (int): The special_property_name of this SpecialModelName. # noqa: E501 + """ + return self.__get_item('special_property_name') + + @special_property_name.setter + def special_property_name(self, value): + """Sets the special_property_name of this SpecialModelName. # noqa: E501 + """ + return self.__set_item('special_property_name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpecialModelName): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py new file mode 100644 index 000000000000..1d10f9a8d7ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class StringBooleanMap(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + } + + openapi_types = { + } + + validations = { + } + + additional_properties_type = (bool,) # noqa: E501 + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """StringBooleanMap - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StringBooleanMap): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py new file mode 100644 index 000000000000..4e1fd5ef077e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Tag(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Tag - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Tag. # noqa: E501 + + Returns: + (int): The id of this Tag. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Tag. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def name(self): + """Gets the name of this Tag. # noqa: E501 + + Returns: + (str): The name of this Tag. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Tag. # noqa: E501 + """ + return self.__set_item('name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Tag): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py new file mode 100644 index 000000000000..6d4d4539a849 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py @@ -0,0 +1,362 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class User(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'username': 'username', # noqa: E501 + 'first_name': 'firstName', # noqa: E501 + 'last_name': 'lastName', # noqa: E501 + 'email': 'email', # noqa: E501 + 'password': 'password', # noqa: E501 + 'phone': 'phone', # noqa: E501 + 'user_status': 'userStatus' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'username': (str,), # noqa: E501 + 'first_name': (str,), # noqa: E501 + 'last_name': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'phone': (str,), # noqa: E501 + 'user_status': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """User - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this User. # noqa: E501 + + Returns: + (int): The id of this User. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this User. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def username(self): + """Gets the username of this User. # noqa: E501 + + Returns: + (str): The username of this User. # noqa: E501 + """ + return self.__get_item('username') + + @username.setter + def username(self, value): + """Sets the username of this User. # noqa: E501 + """ + return self.__set_item('username', value) + + @property + def first_name(self): + """Gets the first_name of this User. # noqa: E501 + + Returns: + (str): The first_name of this User. # noqa: E501 + """ + return self.__get_item('first_name') + + @first_name.setter + def first_name(self, value): + """Sets the first_name of this User. # noqa: E501 + """ + return self.__set_item('first_name', value) + + @property + def last_name(self): + """Gets the last_name of this User. # noqa: E501 + + Returns: + (str): The last_name of this User. # noqa: E501 + """ + return self.__get_item('last_name') + + @last_name.setter + def last_name(self, value): + """Sets the last_name of this User. # noqa: E501 + """ + return self.__set_item('last_name', value) + + @property + def email(self): + """Gets the email of this User. # noqa: E501 + + Returns: + (str): The email of this User. # noqa: E501 + """ + return self.__get_item('email') + + @email.setter + def email(self, value): + """Sets the email of this User. # noqa: E501 + """ + return self.__set_item('email', value) + + @property + def password(self): + """Gets the password of this User. # noqa: E501 + + Returns: + (str): The password of this User. # noqa: E501 + """ + return self.__get_item('password') + + @password.setter + def password(self, value): + """Sets the password of this User. # noqa: E501 + """ + return self.__set_item('password', value) + + @property + def phone(self): + """Gets the phone of this User. # noqa: E501 + + Returns: + (str): The phone of this User. # noqa: E501 + """ + return self.__get_item('phone') + + @phone.setter + def phone(self, value): + """Sets the phone of this User. # noqa: E501 + """ + return self.__set_item('phone', value) + + @property + def user_status(self): + """Gets the user_status of this User. # noqa: E501 + User Status # noqa: E501 + + Returns: + (int): The user_status of this User. # noqa: E501 + """ + return self.__get_item('user_status') + + @user_status.setter + def user_status(self, value): + """Sets the user_status of this User. # noqa: E501 + User Status # noqa: E501 + """ + return self.__set_item('user_status', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, User): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py new file mode 100644 index 000000000000..7ed815b8a187 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode +import urllib3 + +from petstore_api.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt new file mode 100644 index 000000000000..eb358efd5bd3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/requirements.txt @@ -0,0 +1,6 @@ +certifi >= 14.05.14 +future; python_version<="2.7" +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py new file mode 100644 index 000000000000..b896f2ff0b68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES.append("pem>=19.3.0") +REQUIRES.append("pycryptodome>=3.9.0") +EXTRAS = {':python_version <= "2.7"': ['future']} + +setup( + name=NAME, + version=VERSION, + description="OpenAPI Petstore", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + install_requires=REQUIRES, + extras_require=EXTRAS, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache-2.0", + long_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: \" \\ # noqa: E501 + """ +) diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt new file mode 100644 index 000000000000..5816b8749532 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -0,0 +1,7 @@ +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 +mock; python_version<="2.7" + diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/petstore/python-experimental/test/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py new file mode 100644 index 000000000000..af455282e558 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py new file mode 100644 index 000000000000..36e8afaaa7dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.animal import Animal # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.animal.Animal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py new file mode 100644 index 000000000000..d95798cfc5a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_call_123_test_special_tags(self): + """Test case for call_123_test_special_tags + + To test special tags # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py new file mode 100644 index 000000000000..5032e2a92160 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.api_response import ApiResponse # noqa: E501 +from petstore_api.rest import ApiException + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py new file mode 100644 index 000000000000..c938bf374df7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py new file mode 100644 index 000000000000..8148b493c1bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py new file mode 100644 index 000000000000..a463e28234e8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.array_test import ArrayTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py new file mode 100644 index 000000000000..d8bba72f3d1b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.capitalization import Capitalization # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py new file mode 100644 index 000000000000..06008bf4aaad --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.cat import Cat # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.cat.Cat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py new file mode 100644 index 000000000000..496e348e1d54 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCatAllOf(unittest.TestCase): + """CatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCatAllOf(self): + """Test CatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py new file mode 100644 index 000000000000..257ef19234ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.category import Category # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.category.Category() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py new file mode 100644 index 000000000000..6fa92ec9070f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.class_model import ClassModel # noqa: E501 +from petstore_api.rest import ApiException + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.class_model.ClassModel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py new file mode 100644 index 000000000000..d7425ab273e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.client import Client # noqa: E501 +from petstore_api.rest import ApiException + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.client.Client() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py new file mode 100644 index 000000000000..50e7c57bd0bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.default_api import DefaultApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501 + + def tearDown(self): + pass + + def test_foo_get(self): + """Test case for foo_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py new file mode 100644 index 000000000000..56e58d709f0d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.dog import Dog # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """Test Dog""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.dog.Dog() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py new file mode 100644 index 000000000000..8f83f6c7192b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDogAllOf(unittest.TestCase): + """DogAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDogAllOf(self): + """Test DogAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py new file mode 100644 index 000000000000..02f5019ec643 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 +from petstore_api.rest import ApiException + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumArrays(self): + """Test EnumArrays""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py new file mode 100644 index 000000000000..87a14751a178 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.enum_class import EnumClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py new file mode 100644 index 000000000000..be0bd7859b39 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.enum_test import EnumTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py new file mode 100644 index 000000000000..581d1499eedf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_fake_health_get(self): + """Test case for fake_health_get + + Health check endpoint # noqa: E501 + """ + pass + + def test_fake_outer_boolean_serialize(self): + """Test case for fake_outer_boolean_serialize + + """ + pass + + def test_fake_outer_composite_serialize(self): + """Test case for fake_outer_composite_serialize + + """ + pass + + def test_fake_outer_number_serialize(self): + """Test case for fake_outer_number_serialize + + """ + pass + + def test_fake_outer_string_serialize(self): + """Test case for fake_outer_string_serialize + + """ + pass + + def test_test_body_with_file_schema(self): + """Test case for test_body_with_file_schema + + """ + pass + + def test_test_body_with_query_params(self): + """Test case for test_body_with_query_params + + """ + pass + + def test_test_client_model(self): + """Test case for test_client_model + + To test \"client\" model # noqa: E501 + """ + pass + + def test_test_endpoint_parameters(self): + """Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + """ + pass + + def test_test_enum_parameters(self): + """Test case for test_enum_parameters + + To test enum parameters # noqa: E501 + """ + pass + + def test_test_group_parameters(self): + """Test case for test_group_parameters + + Fake endpoint to test group parameters (optional) # noqa: E501 + """ + pass + + def test_test_inline_additional_properties(self): + """Test case for test_inline_additional_properties + + test inline additionalProperties # noqa: E501 + """ + pass + + def test_test_json_form_data(self): + """Test case for test_json_form_data + + test json serialization of form data # noqa: E501 + """ + pass + + def test_test_query_parameter_collection_format(self): + """Test case for test_query_parameter_collection_format + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py new file mode 100644 index 000000000000..f54e0d06644f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py new file mode 100644 index 000000000000..6c30ca900683 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.file import File # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFile(unittest.TestCase): + """File unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFile(self): + """Test File""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.file.File() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py new file mode 100644 index 000000000000..30ba7dffbfca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFileSchemaTestClass(self): + """Test FileSchemaTestClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py new file mode 100644 index 000000000000..1c4d0794d85e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.foo import Foo # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFoo(unittest.TestCase): + """Foo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFoo(self): + """Test Foo""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.foo.Foo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py new file mode 100644 index 000000000000..b7ddece031f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.format_test import FormatTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFormatTest(self): + """Test FormatTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.format_test.FormatTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py new file mode 100644 index 000000000000..308ad18085d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py new file mode 100644 index 000000000000..7fcee8775e07 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501 +from petstore_api.rest import ApiException + + +class TestHealthCheckResult(unittest.TestCase): + """HealthCheckResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHealthCheckResult(self): + """Test HealthCheckResult""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py new file mode 100644 index 000000000000..5247a9683ba8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object import InlineObject # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject(unittest.TestCase): + """InlineObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject(self): + """Test InlineObject""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object.InlineObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py new file mode 100644 index 000000000000..79045ee8624b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object1 import InlineObject1 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject1(unittest.TestCase): + """InlineObject1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject1(self): + """Test InlineObject1""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object1.InlineObject1() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py new file mode 100644 index 000000000000..cf25ce661569 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object2 import InlineObject2 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject2(unittest.TestCase): + """InlineObject2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject2(self): + """Test InlineObject2""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object2.InlineObject2() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py new file mode 100644 index 000000000000..b48bc0c7d1f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object3 import InlineObject3 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject3(unittest.TestCase): + """InlineObject3 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject3(self): + """Test InlineObject3""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object3.InlineObject3() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py new file mode 100644 index 000000000000..4db27423b858 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object4 import InlineObject4 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject4(unittest.TestCase): + """InlineObject4 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject4(self): + """Test InlineObject4""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object4.InlineObject4() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py new file mode 100644 index 000000000000..229bada2af53 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object5 import InlineObject5 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject5(unittest.TestCase): + """InlineObject5 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject5(self): + """Test InlineObject5""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object5.InlineObject5() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py new file mode 100644 index 000000000000..2f77f14b9f84 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_response_default import InlineResponseDefault # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineResponseDefault(unittest.TestCase): + """InlineResponseDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponseDefault(self): + """Test InlineResponseDefault""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_response_default.InlineResponseDefault() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py new file mode 100644 index 000000000000..dc1ac9d82e50 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.list import List # noqa: E501 +from petstore_api.rest import ApiException + + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """Test List""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.list.List() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py new file mode 100644 index 000000000000..e34d75cab4e3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.map_test import MapTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMapTest(self): + """Test MapTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.map_test.MapTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..294ef15f1572 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py new file mode 100644 index 000000000000..5c98c9b3ee14 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.model200_response import Model200Response # noqa: E501 +from petstore_api.rest import ApiException + + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py new file mode 100644 index 000000000000..7dcfacc1fbb8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.model_return import ModelReturn # noqa: E501 +from petstore_api.rest import ApiException + + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py new file mode 100644 index 000000000000..f421e0a7ebe6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.name import Name # noqa: E501 +from petstore_api.rest import ApiException + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.name.Name() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py new file mode 100644 index 000000000000..eaa1aace505a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.nullable_class import NullableClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestNullableClass(unittest.TestCase): + """NullableClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNullableClass(self): + """Test NullableClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py new file mode 100644 index 000000000000..43d5df2ac75f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.number_only import NumberOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py new file mode 100644 index 000000000000..f9bcbc3cab85 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.order import Order # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """Test Order""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.order.Order() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py new file mode 100644 index 000000000000..af3b218592c5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_composite import OuterComposite # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterComposite(unittest.TestCase): + """OuterComposite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """Test OuterComposite""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py new file mode 100644 index 000000000000..bf6441407505 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum import OuterEnum # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnum(unittest.TestCase): + """OuterEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """Test OuterEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py new file mode 100644 index 000000000000..cb3c112b0ec3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnumDefaultValue(unittest.TestCase): + """OuterEnumDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumDefaultValue(self): + """Test OuterEnumDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum_default_value.OuterEnumDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py new file mode 100644 index 000000000000..34b0d1cc0250 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnumInteger(unittest.TestCase): + """OuterEnumInteger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumInteger(self): + """Test OuterEnumInteger""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum_integer.OuterEnumInteger() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py new file mode 100644 index 000000000000..53158d0ce2e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnumIntegerDefaultValue(unittest.TestCase): + """OuterEnumIntegerDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumIntegerDefaultValue(self): + """Test OuterEnumIntegerDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum_integer_default_value.OuterEnumIntegerDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py new file mode 100644 index 000000000000..b05f6aad6a8a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.pet import Pet # noqa: E501 +from petstore_api.rest import ApiException + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPet(self): + """Test Pet""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.pet.Pet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py new file mode 100644 index 000000000000..77665df879f1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_pet(self): + """Test case for add_pet + + Add a new pet to the store # noqa: E501 + """ + pass + + def test_delete_pet(self): + """Test case for delete_pet + + Deletes a pet # noqa: E501 + """ + pass + + def test_find_pets_by_status(self): + """Test case for find_pets_by_status + + Finds Pets by status # noqa: E501 + """ + pass + + def test_find_pets_by_tags(self): + """Test case for find_pets_by_tags + + Finds Pets by tags # noqa: E501 + """ + pass + + def test_get_pet_by_id(self): + """Test case for get_pet_by_id + + Find pet by ID # noqa: E501 + """ + pass + + def test_update_pet(self): + """Test case for update_pet + + Update an existing pet # noqa: E501 + """ + pass + + def test_update_pet_with_form(self): + """Test case for update_pet_with_form + + Updates a pet in the store with form data # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads an image # noqa: E501 + """ + pass + + def test_upload_file_with_required_file(self): + """Test case for upload_file_with_required_file + + uploads an image (required) # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py new file mode 100644 index 000000000000..9223d493aff0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 +from petstore_api.rest import ApiException + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py new file mode 100644 index 000000000000..5c9f30f71fec --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 +from petstore_api.rest import ApiException + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py new file mode 100644 index 000000000000..81848d24a67e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_order(self): + """Test case for delete_order + + Delete purchase order by ID # noqa: E501 + """ + pass + + def test_get_inventory(self): + """Test case for get_inventory + + Returns pet inventories by status # noqa: E501 + """ + pass + + def test_get_order_by_id(self): + """Test case for get_order_by_id + + Find purchase order by ID # noqa: E501 + """ + pass + + def test_place_order(self): + """Test case for place_order + + Place an order for a pet # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py new file mode 100644 index 000000000000..31c1ebeec5db --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.string_boolean_map import StringBooleanMap # noqa: E501 +from petstore_api.rest import ApiException + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringBooleanMap(self): + """Test StringBooleanMap""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.string_boolean_map.StringBooleanMap() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py new file mode 100644 index 000000000000..b0c8ef0c6816 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.tag import Tag # noqa: E501 +from petstore_api.rest import ApiException + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.tag.Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py new file mode 100644 index 000000000000..cb026e3edb5b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.user import User # noqa: E501 +from petstore_api.rest import ApiException + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.user.User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py new file mode 100644 index 000000000000..6df730fba2b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.user_api.UserApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_user(self): + """Test case for create_user + + Create user # noqa: E501 + """ + pass + + def test_create_users_with_array_input(self): + """Test case for create_users_with_array_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_create_users_with_list_input(self): + """Test case for create_users_with_list_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_delete_user(self): + """Test case for delete_user + + Delete user # noqa: E501 + """ + pass + + def test_get_user_by_name(self): + """Test case for get_user_by_name + + Get user by user name # noqa: E501 + """ + pass + + def test_login_user(self): + """Test case for login_user + + Logs user into the system # noqa: E501 + """ + pass + + def test_logout_user(self): + """Test case for logout_user + + Logs out current logged in user session # noqa: E501 + """ + pass + + def test_update_user(self): + """Test case for update_user + + Updated user # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests/__init__.py b/samples/openapi3/client/petstore/python-experimental/tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py b/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py new file mode 100644 index 000000000000..51fb281e7bdf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py @@ -0,0 +1,225 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIetstore-python +$ nosetests -v +""" + +import os +import time +import unittest +from dateutil.parser import parse +from Crypto.PublicKey import RSA, ECC + +import petstore_api +import petstore_api.configuration + +HOST = 'http://petstore.swagger.io/v2' + + +class ApiClientTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + + def test_http_signature(self): + """ Test HTTP signature authentication. + """ + header_params = { + 'test1': 'value1', + 'test2': 'value2', + 'Content-Type': 'application/json' + } + query_params = {'test2': 'value2'} + auth_settings = ['http_signature_test'] + + # Generate RSA key for test purpose + rsakey = RSA.generate(2048) + # Generate ECDSA key for test purpose + ecdsakey = ECC.generate(curve='p521') + #ecdsakey = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p) + + for privkey in [ rsakey, ecdsakey ]: + config = petstore_api.Configuration() + config.host = 'http://localhost/' + config.key_id = 'test-key' + config.private_key_path = None + config.signing_scheme = 'hs2019' + config.signed_headers = ['test1', 'Content-Type'] + config.private_key = privkey + if isinstance(privkey, RSA.RsaKey): + signing_algorithms = ['PKCS1-v1_5', 'PSS'] + elif isinstance(privkey, ECC.EccKey): + signing_algorithms = ['fips-186-3', 'deterministic-rfc6979'] + + for signing_algorithm in signing_algorithms: + config.signing_algorithm = signing_algorithm + + client = petstore_api.ApiClient(config) + + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings, + resource_path='/pet', method='POST', body='{ }') + self.assertTrue('Digest' in header_params) + self.assertTrue('Authorization' in header_params) + self.assertTrue('Date' in header_params) + self.assertTrue('Host' in header_params) + #for hdr_key, hdr_value in header_params.items(): + # print("HEADER: {0}={1}".format(hdr_key, hdr_value)) + + def test_configuration(self): + config = petstore_api.Configuration() + config.host = 'http://localhost/' + + # Test api_key authentication + config.api_key['api_key'] = '123456' + config.api_key_prefix['api_key'] = 'PREFIX' + config.username = 'test_username' + config.password = 'test_password' + + header_params = {'test1': 'value1'} + query_params = {'test2': 'value2'} + auth_settings = ['api_key', 'unknown'] + + client = petstore_api.ApiClient(config) + + # test prefix + self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) + + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings) + + # test api key auth + self.assertEqual(header_params['test1'], 'value1') + self.assertEqual(header_params['api_key'], 'PREFIX 123456') + self.assertEqual(query_params['test2'], 'value2') + + # test basic auth + self.assertEqual('test_username', client.configuration.username) + self.assertEqual('test_password', client.configuration.password) + + def test_select_header_accept(self): + accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/json', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/xml', 'application/json'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['text/plain', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'text/plain, application/xml') + + accepts = [] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, None) + + def test_select_header_content_type(self): + content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/json', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/xml', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['text/plain', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'text/plain') + + content_types = [] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + def test_sanitize_for_serialization(self): + # None + data = None + result = self.api_client.sanitize_for_serialization(None) + self.assertEqual(result, data) + + # str + data = "test string" + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # int + data = 1 + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # bool + data = True + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # date + data = parse("1997-07-16").date() # date + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16") + + # datetime + data = parse("1997-07-16T19:20:30.45+01:00") # datetime + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") + + # list + data = [1] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # dict + data = {"test key": "test value"} + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # model + pet_dict = {"id": 1, "name": "monkey", + "category": {"id": 1, "name": "test category"}, + "tags": [{"id": 1, "name": "test tag1"}, + {"id": 2, "name": "test tag2"}], + "status": "available", + "photoUrls": ["http://foo.bar.com/3", + "http://foo.bar.com/4"]} + pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) + pet.id = pet_dict["id"] + cate = petstore_api.Category() + cate.id = pet_dict["category"]["id"] + cate.name = pet_dict["category"]["name"] + pet.category = cate + tag1 = petstore_api.Tag() + tag1.id = pet_dict["tags"][0]["id"] + tag1.name = pet_dict["tags"][0]["name"] + tag2 = petstore_api.Tag() + tag2.id = pet_dict["tags"][1]["id"] + tag2.name = pet_dict["tags"][1]["name"] + pet.tags = [tag1, tag2] + pet.status = pet_dict["status"] + + data = pet + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, pet_dict) + + # list of models + list_of_pet_dict = [pet_dict] + data = [pet] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, list_of_pet_dict) + + # model with additional proerties + model_dict = {'some_key': True} + model = petstore_api.StringBooleanMap(**model_dict) + result = self.api_client.sanitize_for_serialization(model) + self.assertEqual(result, model_dict) diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini new file mode 100644 index 000000000000..3d0be613cfc7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 907737d8b0ec..819dcfdb2e8b 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -193,6 +193,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## http_signature_test + +- **Type**: HTTP basic authentication + + ## petstore_auth - **Type**: OAuth diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 91109c7d78cb..d7eb1fe301be 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -32,11 +32,16 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the key used to sign HTTP requests + :param private_key_path: The path of the file containing a private key, used to sign HTTP requests + :param signing_algorithm: The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -65,6 +70,18 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests + """ self.access_token = "" """access token for OAuth/Bearer """ @@ -107,6 +124,10 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Set this to True/False to enable/disable SSL hostname verification. """ + self.private_key = None + """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. + """ + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is @@ -275,6 +296,13 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_basic_auth_token() }, + 'http_signature_test': + { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + }, 'petstore_auth': { 'type': 'oauth2', @@ -284,6 +312,7 @@ def auth_settings(self): }, } + def to_debug_report(self): """Gets the essential information for debugging. From 1cdc6ab20459e153a55874e4a83f2041799b5a18 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sun, 29 Dec 2019 16:05:14 +0000 Subject: [PATCH 004/102] start implementation of HTTP signature --- .../python-experimental/api_client.mustache | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 25ca4b5043ff..b8e8d2d97129 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -10,6 +10,10 @@ import os # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import quote +from Crypto.PublicKey import RSA +from Crypto.Signature import PKCS1_v1_5 +from Crypto.Hash import SHA256 +from base64 import b64encode {{#tornado}} import tornado.gen {{/tornado}} @@ -542,3 +546,116 @@ class ApiClient(object): raise ApiValueError( 'Authentication token must be in `query` or `header`' ) + + def prepare_auth_header(self, resource_path, method, body, query_params): + """ + Create a message signature for the HTTP request and add the signed headers. + + :param resource_path : resource path which is the api being called upon. + :param method: request type + :param body: body passed in the http request. + :param query_params: query parameters used by the API + :return: instance of digest object + """ + if body is None: + body = '' + else: + body = json.dumps(body) + + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + + request_target = method + " " + target_path + resource_path + + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query + + from email.utils import formatdate + cdate=formatdate(timeval=None, localtime=False, usegmt=True) + + request_body = body.encode() + body_digest = self.get_sha256_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + + headers = {'Content-Type': 'application/json', 'Date' : cdate, 'Host' : target_host, 'Digest' : "SHA-256=" + b64_body_digest.decode('ascii')} + + string_to_sign = self.prepare_str_to_sign(request_target, headers) + + digest = self.get_sha256_digest(string_to_sign.encode()) + + b64_signed_msg = self.get_rsasig_b64encode(self.private_key_file, digest) + + auth_header = self.get_auth_header(headers, b64_signed_msg) + + self.set_default_header('Date', '{0}'.format(cdate)) + self.set_default_header('Host', '{0}'.format(target_host)) + self.set_default_header('Digest', 'SHA-256={0}'.format(b64_body_digest.decode('ascii'))) + self.set_default_header('Authorization', '{0}'.format(auth_header)) + + def get_sha256_digest(self, data): + """ + :param data: Data set by User + :return: instance of digest object + """ + digest = SHA256.new() + digest.update(data) + + return digest + + def get_rsasig_b64encode(self, private_key_path, digest): + """ + :param private_key_path : abs path to private key .pem file. + :param digest: digest + :return: instance of digest object + """ + + key = open(private_key_path, "r").read() + rsakey = RSA.importKey(key) + signer = PKCS1_v1_5.new(rsakey) + sign = signer.sign(digest) + + return b64encode(sign) + + def prepare_str_to_sign(self, req_tgt, hdrs): + """ + :param req_tgt : Request Target as stored in http header. + :param hdrs: HTTP Headers to be signed. + :return: instance of digest object + """ + ss = "" + ss = ss + "(request-target): " + req_tgt.lower() + "\n" + + length = len(hdrs.items()) + + i = 0 + for key, value in hdrs.items(): + ss = ss + key.lower() + ": " + value + if i < length-1: + ss = ss + "\n" + i += 1 + + return ss + + def get_auth_header(self, hdrs, signed_msg): + """ + This method prepares the Auth header string + + :param hdrs : HTTP Headers + :param signed_msg: Signed Digest + :return: instance of digest object + """ + + auth_str = "" + auth_str = auth_str + "Signature" + + auth_str = auth_str + " " + "keyId=\"" + self.api_key_id + "\"," + "algorithm=\"" + self.digest_algorithm + "\"," + "headers=\"(request-target)" + + for key, _ in hdrs.items(): + auth_str = auth_str + " " + key.lower() + auth_str = auth_str + "\"" + + auth_str = auth_str + "," + "signature=\"" + signed_msg.decode('ascii') + "\"" + + return auth_str + From c2fdefa28a8f5268848e2396530730b2d8f29283 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 2 Jan 2020 11:28:50 -0800 Subject: [PATCH 005/102] add api key parameters for http message signature --- .../main/resources/python/configuration.mustache | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index b6a89d495d9c..729578c7cbcd 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -30,7 +30,8 @@ class Configuration(object): def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -59,6 +60,18 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """ The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """ The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. Supported values are rsa-sha256, rsa-sha512, hs2019. + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests. + """ {{#hasOAuthMethods}} self.access_token = "" """access token for OAuth/Bearer From 32a364767e08ab4683fba5290878fcd1143aec5f Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 6 Jan 2020 04:16:40 +0000 Subject: [PATCH 006/102] HTTP signature authentication --- bin/openapi3/python-experimental-petstore.sh | 32 + .../openapitools/codegen/CodegenSecurity.java | 7 +- .../openapitools/codegen/DefaultCodegen.java | 5 + .../codegen/DefaultGenerator.java | 13 + .../resources/python/configuration.mustache | 62 +- .../python-experimental/api_client.mustache | 140 +- .../python/python-experimental/setup.mustache | 4 + ...ith-fake-endpoints-models-for-testing.yaml | 3 + .../python/petstore_api/configuration.py | 21 +- .../petstore/python-experimental/.gitignore | 64 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../petstore/python-experimental/.travis.yml | 14 + .../petstore/python-experimental/README.md | 216 ++ .../docs/AdditionalPropertiesClass.md | 11 + .../python-experimental/docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 63 + .../python-experimental/docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../python-experimental/docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../petstore/python-experimental/docs/Cat.md | 12 + .../python-experimental/docs/CatAllOf.md | 10 + .../python-experimental/docs/Category.md | 11 + .../python-experimental/docs/ClassModel.md | 11 + .../python-experimental/docs/Client.md | 10 + .../python-experimental/docs/DefaultApi.md | 56 + .../petstore/python-experimental/docs/Dog.md | 12 + .../python-experimental/docs/DogAllOf.md | 10 + .../python-experimental/docs/EnumArrays.md | 11 + .../python-experimental/docs/EnumClass.md | 10 + .../python-experimental/docs/EnumTest.md | 17 + .../python-experimental/docs/FakeApi.md | 828 +++++++ .../docs/FakeClassnameTags123Api.md | 71 + .../petstore/python-experimental/docs/File.md | 11 + .../docs/FileSchemaTestClass.md | 11 + .../petstore/python-experimental/docs/Foo.md | 10 + .../python-experimental/docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 11 + .../python-experimental/docs/InlineObject.md | 11 + .../python-experimental/docs/InlineObject1.md | 11 + .../python-experimental/docs/InlineObject2.md | 11 + .../python-experimental/docs/InlineObject3.md | 23 + .../python-experimental/docs/InlineObject4.md | 11 + .../python-experimental/docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../petstore/python-experimental/docs/List.md | 10 + .../python-experimental/docs/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/Model200Response.md | 12 + .../python-experimental/docs/ModelReturn.md | 11 + .../petstore/python-experimental/docs/Name.md | 14 + .../python-experimental/docs/NullableClass.md | 22 + .../python-experimental/docs/NumberOnly.md | 10 + .../python-experimental/docs/Order.md | 15 + .../docs/OuterComposite.md | 12 + .../python-experimental/docs/OuterEnum.md | 10 + .../docs/OuterEnumDefaultValue.md | 10 + .../docs/OuterEnumInteger.md | 10 + .../docs/OuterEnumIntegerDefaultValue.md | 10 + .../petstore/python-experimental/docs/Pet.md | 15 + .../python-experimental/docs/PetApi.md | 563 +++++ .../python-experimental/docs/ReadOnlyFirst.md | 11 + .../docs/SpecialModelName.md | 10 + .../python-experimental/docs/StoreApi.md | 233 ++ .../docs/StringBooleanMap.md | 10 + .../petstore/python-experimental/docs/Tag.md | 11 + .../petstore/python-experimental/docs/User.md | 17 + .../python-experimental/docs/UserApi.md | 437 ++++ .../petstore/python-experimental/git_push.sh | 58 + .../petstore_api/__init__.py | 87 + .../petstore_api/api/__init__.py | 12 + .../petstore_api/api/another_fake_api.py | 375 +++ .../petstore_api/api/default_api.py | 365 +++ .../petstore_api/api/fake_api.py | 2016 +++++++++++++++++ .../api/fake_classname_tags_123_api.py | 377 +++ .../petstore_api/api/pet_api.py | 1292 +++++++++++ .../petstore_api/api/store_api.py | 692 ++++++ .../petstore_api/api/user_api.py | 1111 +++++++++ .../petstore_api/api_client.py | 698 ++++++ .../petstore_api/configuration.py | 436 ++++ .../petstore_api/exceptions.py | 120 + .../petstore_api/model_utils.py | 876 +++++++ .../petstore_api/models/__init__.py | 66 + .../models/additional_properties_class.py | 252 +++ .../petstore_api/models/animal.py | 270 +++ .../petstore_api/models/api_response.py | 270 +++ .../models/array_of_array_of_number_only.py | 234 ++ .../models/array_of_number_only.py | 234 ++ .../petstore_api/models/array_test.py | 271 +++ .../petstore_api/models/capitalization.py | 326 +++ .../petstore_api/models/cat.py | 272 +++ .../petstore_api/models/cat_all_of.py | 234 ++ .../petstore_api/models/category.py | 254 +++ .../petstore_api/models/class_model.py | 234 ++ .../petstore_api/models/client.py | 234 ++ .../petstore_api/models/dog.py | 272 +++ .../petstore_api/models/dog_all_of.py | 234 ++ .../petstore_api/models/enum_arrays.py | 260 +++ .../petstore_api/models/enum_class.py | 226 ++ .../petstore_api/models/enum_test.py | 384 ++++ .../petstore_api/models/file.py | 236 ++ .../models/file_schema_test_class.py | 253 +++ .../petstore_api/models/foo.py | 234 ++ .../petstore_api/models/format_test.py | 536 +++++ .../petstore_api/models/has_only_read_only.py | 252 +++ .../models/health_check_result.py | 234 ++ .../petstore_api/models/inline_object.py | 256 +++ .../petstore_api/models/inline_object1.py | 256 +++ .../petstore_api/models/inline_object2.py | 265 +++ .../petstore_api/models/inline_object3.py | 535 +++++ .../petstore_api/models/inline_object4.py | 259 +++ .../petstore_api/models/inline_object5.py | 258 +++ .../models/inline_response_default.py | 235 ++ .../petstore_api/models/list.py | 234 ++ .../petstore_api/models/map_test.py | 293 +++ ...perties_and_additional_properties_class.py | 271 +++ .../petstore_api/models/model200_response.py | 252 +++ .../petstore_api/models/model_return.py | 234 ++ .../petstore_api/models/name.py | 290 +++ .../petstore_api/models/nullable_class.py | 432 ++++ .../petstore_api/models/number_only.py | 234 ++ .../petstore_api/models/order.py | 331 +++ .../petstore_api/models/outer_composite.py | 270 +++ .../petstore_api/models/outer_enum.py | 227 ++ .../models/outer_enum_default_value.py | 226 ++ .../petstore_api/models/outer_enum_integer.py | 226 ++ .../outer_enum_integer_default_value.py | 226 ++ .../petstore_api/models/pet.py | 336 +++ .../petstore_api/models/read_only_first.py | 252 +++ .../petstore_api/models/special_model_name.py | 234 ++ .../petstore_api/models/string_boolean_map.py | 216 ++ .../petstore_api/models/tag.py | 252 +++ .../petstore_api/models/user.py | 362 +++ .../python-experimental/petstore_api/rest.py | 296 +++ .../python-experimental/requirements.txt | 6 + .../petstore/python-experimental/setup.py | 45 + .../python-experimental/test-requirements.txt | 7 + .../python-experimental/test/__init__.py | 0 .../test/test_additional_properties_class.py | 39 + .../python-experimental/test/test_animal.py | 39 + .../test/test_another_fake_api.py | 40 + .../test/test_api_response.py | 39 + .../test_array_of_array_of_number_only.py | 39 + .../test/test_array_of_number_only.py | 39 + .../test/test_array_test.py | 39 + .../test/test_capitalization.py | 39 + .../python-experimental/test/test_cat.py | 39 + .../test/test_cat_all_of.py | 39 + .../python-experimental/test/test_category.py | 39 + .../test/test_class_model.py | 39 + .../python-experimental/test/test_client.py | 39 + .../test/test_default_api.py | 39 + .../python-experimental/test/test_dog.py | 39 + .../test/test_dog_all_of.py | 39 + .../test/test_enum_arrays.py | 39 + .../test/test_enum_class.py | 39 + .../test/test_enum_test.py | 39 + .../python-experimental/test/test_fake_api.py | 124 + .../test/test_fake_classname_tags_123_api.py | 40 + .../python-experimental/test/test_file.py | 39 + .../test/test_file_schema_test_class.py | 39 + .../python-experimental/test/test_foo.py | 39 + .../test/test_format_test.py | 39 + .../test/test_has_only_read_only.py | 39 + .../test/test_health_check_result.py | 39 + .../test/test_inline_object.py | 39 + .../test/test_inline_object1.py | 39 + .../test/test_inline_object2.py | 39 + .../test/test_inline_object3.py | 39 + .../test/test_inline_object4.py | 39 + .../test/test_inline_object5.py | 39 + .../test/test_inline_response_default.py | 39 + .../python-experimental/test/test_list.py | 39 + .../python-experimental/test/test_map_test.py | 39 + ...perties_and_additional_properties_class.py | 39 + .../test/test_model200_response.py | 39 + .../test/test_model_return.py | 39 + .../python-experimental/test/test_name.py | 39 + .../test/test_nullable_class.py | 39 + .../test/test_number_only.py | 39 + .../python-experimental/test/test_order.py | 39 + .../test/test_outer_composite.py | 39 + .../test/test_outer_enum.py | 39 + .../test/test_outer_enum_default_value.py | 39 + .../test/test_outer_enum_integer.py | 39 + .../test_outer_enum_integer_default_value.py | 39 + .../python-experimental/test/test_pet.py | 39 + .../python-experimental/test/test_pet_api.py | 96 + .../test/test_read_only_first.py | 39 + .../test/test_special_model_name.py | 39 + .../test/test_store_api.py | 61 + .../test/test_string_boolean_map.py | 39 + .../python-experimental/test/test_tag.py | 39 + .../python-experimental/test/test_user.py | 39 + .../python-experimental/test/test_user_api.py | 89 + .../python-experimental/tests/__init__.py | 0 .../tests/test_api_client.py | 225 ++ .../petstore/python-experimental/tox.ini | 10 + .../openapi3/client/petstore/python/README.md | 5 + .../python/petstore_api/configuration.py | 31 +- 203 files changed, 28720 insertions(+), 55 deletions(-) create mode 100755 bin/openapi3/python-experimental-petstore.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/.gitignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/python-experimental/.travis.yml create mode 100644 samples/openapi3/client/petstore/python-experimental/README.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Category.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Client.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/File.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/List.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Name.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Order.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/User.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/git_push.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py create mode 100644 samples/openapi3/client/petstore/python-experimental/requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/test/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tox.ini diff --git a/bin/openapi3/python-experimental-petstore.sh b/bin/openapi3/python-experimental-petstore.sh new file mode 100755 index 000000000000..7b4007372b23 --- /dev/null +++ b/bin/openapi3/python-experimental-petstore.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index e7abb8c90d1a..0e2618ef5d98 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -30,7 +30,7 @@ public class CodegenSecurity { public String scheme; public Boolean hasMore, isBasic, isOAuth, isApiKey; // is Basic is true for all http authentication type. Those are to differentiate basic and bearer authentication - public Boolean isBasicBasic, isBasicBearer; + public Boolean isBasicBasic, isBasicBearer, isHttpSignature; public String bearerFormat; public Map vendorExtensions = new HashMap(); // ApiKey specific @@ -51,6 +51,7 @@ public CodegenSecurity filterByScopeNames(List filterScopes) { filteredSecurity.isBasic = isBasic; filteredSecurity.isBasicBasic = isBasicBasic; filteredSecurity.isBasicBearer = isBasicBearer; + filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isApiKey = isApiKey; filteredSecurity.isOAuth = isOAuth; filteredSecurity.keyParamName = keyParamName; @@ -97,6 +98,7 @@ public boolean equals(Object o) { Objects.equals(isOAuth, that.isOAuth) && Objects.equals(isApiKey, that.isApiKey) && Objects.equals(isBasicBasic, that.isBasicBasic) && + Objects.equals(isHttpSignature, that.isHttpSignature) && Objects.equals(isBasicBearer, that.isBasicBearer) && Objects.equals(bearerFormat, that.bearerFormat) && Objects.equals(vendorExtensions, that.vendorExtensions) && @@ -117,7 +119,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isBasicBearer, + return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isHttpSignature, isBasicBearer, bearerFormat, vendorExtensions, keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow, authorizationUrl, tokenUrl, scopes, isCode, isPassword, isApplication, isImplicit); } @@ -134,6 +136,7 @@ public String toString() { sb.append(", isApiKey=").append(isApiKey); sb.append(", isBasicBasic=").append(isBasicBasic); sb.append(", isBasicBearer=").append(isBasicBearer); + sb.append(", isHttpSignature=").append(isHttpSignature); sb.append(", bearerFormat='").append(bearerFormat).append('\''); sb.append(", vendorExtensions=").append(vendorExtensions); sb.append(", keyParamName='").append(keyParamName).append('\''); 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 df595d68f08f..eb1d1b25bc97 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 @@ -3552,6 +3552,7 @@ public List fromSecurity(Map securitySc cs.name = key; cs.type = securityScheme.getType().toString(); cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = false; + cs.isHttpSignature = false; cs.isBasicBasic = cs.isBasicBearer = false; cs.scheme = securityScheme.getScheme(); if (securityScheme.getExtensions() != null) { @@ -3573,6 +3574,10 @@ public List fromSecurity(Map securitySc } else if ("bearer".equals(securityScheme.getScheme())) { cs.isBasicBearer = true; cs.bearerFormat = securityScheme.getBearerFormat(); + } else if ("signature".equals(securityScheme.getScheme())) { + cs.isHttpSignature = true; + } else { + throw new RuntimeException("Unsupported security scheme: " + securityScheme.getScheme()); } } else if (SecurityScheme.Type.OAUTH2.equals(securityScheme.getType())) { cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isBasic = false; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 2d263ed3867b..7d3eb5dbab09 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -851,6 +851,9 @@ private Map buildSupportFileBundle(List allOperations, L if (hasBearerMethods(authMethods)) { bundle.put("hasBearerMethods", true); } + if (hasHttpSignatureMethods(authMethods)) { + bundle.put("hasHttpSignatureMethods", true); + } } List servers = config.fromServers(openAPI.getServers()); @@ -1332,6 +1335,16 @@ private boolean hasBearerMethods(List authMethods) { return false; } + private boolean hasHttpSignatureMethods(List authMethods) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isHttpSignature)) { + return true; + } + } + + return false; + } + private List getOAuthMethods(List authMethods) { List oauthMethods = new ArrayList<>(); diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 729578c7cbcd..5e0ea41b33ea 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -8,6 +8,10 @@ import logging {{^asyncio}} import multiprocessing {{/asyncio}} +{{#hasHttpSignatureMethods}} +import pem +from Crypto.PublicKey import RSA, ECC +{{/hasHttpSignatureMethods}} import sys import urllib3 @@ -26,12 +30,17 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + :param private_key_path: The path of the file containing a private key, when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. Supported values is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. """ def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -61,13 +70,18 @@ class Configuration(object): """Password for HTTP basic authentication """ self.key_id = key_id - """ The identifier of the key used to sign HTTP requests. + """The identifier of the key used to sign HTTP requests. """ self.private_key_path = private_key_path - """ The path of the file containing a private key, used to sign HTTP requests. + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. Supported values are rsa-sha256, rsa-sha512, hs2019. + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers """A list of HTTP headers that must be signed, when signing HTTP requests. @@ -123,6 +137,12 @@ class Configuration(object): """Set this to True/False to enable/disable SSL hostname verification. """ +{{#hasHttpSignatureMethods}} + self.private_key = None + """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. + """ +{{/hasHttpSignatureMethods}} + {{#asyncio}} self.connection_pool_maxsize = 100 """This value is passed to the aiohttp to limit simultaneous connections. @@ -281,7 +301,7 @@ class Configuration(object): }, {{/isApiKey}} {{#isBasic}} - {{^isBasicBearer}} + {{#isBasicBasic}} '{{name}}': { 'type': 'basic', @@ -289,7 +309,7 @@ class Configuration(object): 'key': 'Authorization', 'value': self.get_basic_auth_token() }, - {{/isBasicBearer}} + {{/isBasicBasic}} {{#isBasicBearer}} '{{name}}': { @@ -302,6 +322,15 @@ class Configuration(object): 'value': 'Bearer ' + self.access_token }, {{/isBasicBearer}} + {{#isHttpSignature}} + '{{name}}': + { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + }, + {{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} '{{name}}': @@ -315,6 +344,27 @@ class Configuration(object): {{/authMethods}} } +{{#hasHttpSignatureMethods}} + def load_private_key(self): + """Load the private key used to sign HTTP requests. + """ + if self.private_key is not None: + return + with open(self.private_key_path, "rb") as f: + # Decode PEM file and determine key type from PEM header. + # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". + keys = pem.parse(f.read()) + if len(keys) != 1: + raise Exception("File must contain exactly one private key") + key = keys[0].as_text() + if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): + self.private_key = RSA.importKey(key) + elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): + self.private_key = ECC.importKey(key) + else: + raise Exception("Unsupported key") +{{/hasHttpSignatureMethods}} + def to_debug_report(self): """Gets the essential information for debugging. diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index b8e8d2d97129..ef64540102ce 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -9,11 +9,13 @@ import os # python 2 and python 3 compatibility library import six -from six.moves.urllib.parse import quote -from Crypto.PublicKey import RSA -from Crypto.Signature import PKCS1_v1_5 -from Crypto.Hash import SHA256 +from six.moves.urllib.parse import quote, urlencode, urlparse +{{#hasHttpSignatureMethods}} +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from Crypto.Hash import SHA256, SHA512 from base64 import b64encode +{{/hasHttpSignatureMethods}} {{#tornado}} import tornado.gen {{/tornado}} @@ -155,7 +157,7 @@ class ApiClient(object): post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) + self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) # body if body: @@ -521,12 +523,15 @@ class ApiClient(object): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: The HTTP request resource path. + :method: The HTTP request method. + :body: The body of the HTTP request. """ if not auth_settings: return @@ -534,6 +539,14 @@ class ApiClient(object): for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: +{{#hasHttpSignatureMethods}} + if auth_setting['type'] == 'http-signature': + # The HTTP signature scheme requires multiple HTTP headers that are calculated dynamically. + auth_headers = self.get_http_signature_headers(resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers[key] = value + continue +{{/hasHttpSignatureMethods}} if not auth_setting['value']: continue elif auth_setting['in'] == 'cookie': @@ -547,25 +560,31 @@ class ApiClient(object): 'Authentication token must be in `query` or `header`' ) - def prepare_auth_header(self, resource_path, method, body, query_params): +{{#hasHttpSignatureMethods}} + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): """ Create a message signature for the HTTP request and add the signed headers. :param resource_path : resource path which is the api being called upon. - :param method: request type + :param method: the HTTP request method. + :param headers: the request headers. :param body: body passed in the http request. :param query_params: query parameters used by the API :return: instance of digest object """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") if body is None: body = '' else: body = json.dumps(body) - target_host = urlparse(self.host).netloc - target_path = urlparse(self.host).path + target_host = urlparse(self.configuration.host).netloc + target_path = urlparse(self.configuration.host).path - request_target = method + " " + target_path + resource_path + request_target = method.lower() + " " + target_path + resource_path if query_params: raw_query = urlencode(query_params).replace('+', '%20') @@ -575,56 +594,86 @@ class ApiClient(object): cdate=formatdate(timeval=None, localtime=False, usegmt=True) request_body = body.encode() - body_digest = self.get_sha256_digest(request_body) + body_digest, digest_prefix = self.get_message_digest(request_body) b64_body_digest = b64encode(body_digest.digest()) - headers = {'Content-Type': 'application/json', 'Date' : cdate, 'Host' : target_host, 'Digest' : "SHA-256=" + b64_body_digest.decode('ascii')} - - string_to_sign = self.prepare_str_to_sign(request_target, headers) + signed_headers = { + 'Date': cdate, + 'Host': target_host, + 'Digest': digest_prefix + b64_body_digest.decode('ascii') + } + for hdr_key in self.configuration.signed_headers: + signed_headers[hdr_key] = headers[hdr_key] - digest = self.get_sha256_digest(string_to_sign.encode()) + string_to_sign = self.get_str_to_sign(request_target, signed_headers) - b64_signed_msg = self.get_rsasig_b64encode(self.private_key_file, digest) + digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) + b64_signed_msg = self.sign_digest(digest) - auth_header = self.get_auth_header(headers, b64_signed_msg) + auth_header = self.get_authorization_header(signed_headers, b64_signed_msg) - self.set_default_header('Date', '{0}'.format(cdate)) - self.set_default_header('Host', '{0}'.format(target_host)) - self.set_default_header('Digest', 'SHA-256={0}'.format(b64_body_digest.decode('ascii'))) - self.set_default_header('Authorization', '{0}'.format(auth_header)) + return { + 'Date': '{0}'.format(cdate), + 'Host': '{0}'.format(target_host), + 'Digest': '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')), + 'Authorization': '{0}'.format(auth_header) + } - def get_sha256_digest(self, data): + def get_message_digest(self, data): """ - :param data: Data set by User - :return: instance of digest object + Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The message to be hashed with a cryptographic hash. + :return: The message digest encoded as a byte string. """ - digest = SHA256.new() + if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: + digest = SHA512.new() + prefix = "SHA-512=" + elif self.configuration.signing_scheme in ["rsa-sha256"]: + digest = SHA256.new() + prefix = "SHA-256=" + else: + raise Exception("Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) digest.update(data) + return digest, prefix - return digest - - def get_rsasig_b64encode(self, private_key_path, digest): - """ - :param private_key_path : abs path to private key .pem file. - :param digest: digest - :return: instance of digest object + def sign_digest(self, digest): """ + Signs a message digest with a private key specified in the configuration. - key = open(private_key_path, "r").read() - rsakey = RSA.importKey(key) - signer = PKCS1_v1_5.new(rsakey) - sign = signer.sign(digest) - - return b64encode(sign) + :param digest: digest of the HTTP message. + :return: the HTTP message signature encoded as a byte string. + """ + self.configuration.load_private_key() + privkey = self.configuration.private_key + if isinstance(privkey, RSA.RsaKey): + if self.configuration.signing_algorithm == 'PSS': + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(privkey).sign(digest) + elif self.configuration.signing_algorithm == 'PKCS1-v1_5': + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(privkey).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + elif isinstance(privkey, ECC.EccKey): + if self.configuration.signing_algorithm in ['fips-186-3', 'deterministic-rfc6979']: + signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + else: + raise Exception("Unsupported private key: {0}".format(type(privkey))) + return b64encode(signature) - def prepare_str_to_sign(self, req_tgt, hdrs): + def get_str_to_sign(self, req_tgt, hdrs): """ + Generate and return a string value representing the HTTP request to be signed. + :param req_tgt : Request Target as stored in http header. :param hdrs: HTTP Headers to be signed. :return: instance of digest object """ ss = "" - ss = ss + "(request-target): " + req_tgt.lower() + "\n" + ss = ss + "(request-target): " + req_tgt + "\n" length = len(hdrs.items()) @@ -637,11 +686,11 @@ class ApiClient(object): return ss - def get_auth_header(self, hdrs, signed_msg): + def get_authorization_header(self, hdrs, signed_msg): """ - This method prepares the Auth header string + Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - :param hdrs : HTTP Headers + :param hdrs : The list of signed HTTP Headers :param signed_msg: Signed Digest :return: instance of digest object """ @@ -649,7 +698,7 @@ class ApiClient(object): auth_str = "" auth_str = auth_str + "Signature" - auth_str = auth_str + " " + "keyId=\"" + self.api_key_id + "\"," + "algorithm=\"" + self.digest_algorithm + "\"," + "headers=\"(request-target)" + auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" for key, _ in hdrs.items(): auth_str = auth_str + " " + key.lower() @@ -659,3 +708,4 @@ class ApiClient(object): return auth_str +{{/hasHttpSignatureMethods}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache index bf9ffe07d08d..9fab9e020b0d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache @@ -23,6 +23,10 @@ REQUIRES.append("aiohttp >= 3.0.0") {{#tornado}} REQUIRES.append("tornado>=4.2,<5") {{/tornado}} +{{#hasHttpSignatureMethods}} +REQUIRES.append("pem>=19.3.0") +REQUIRES.append("pycryptodome>=3.9.0") +{{/hasHttpSignatureMethods}} EXTRAS = {':python_version <= "2.7"': ['future']} setup( diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index f6f35356afc3..d1787509bbbe 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1168,6 +1168,9 @@ components: type: http scheme: bearer bearerFormat: JWT + http_signature_test: + type: http + scheme: signature schemas: Foo: type: object diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index f6f48362e579..d9144f3901ca 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -32,11 +32,16 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests + :param private_key_path: The path of the file containing a private key, when signing HTTP requests + :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -65,6 +70,18 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests + """ self.access_token = "" """access token for OAuth/Bearer """ @@ -107,6 +124,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Set this to True/False to enable/disable SSL hostname verification. """ + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is @@ -276,6 +294,7 @@ def auth_settings(self): }, } + def to_debug_report(self): """Gets the essential information for debugging. diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/petstore/python-experimental/.gitignore new file mode 100644 index 000000000000..a655050c2631 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION new file mode 100644 index 000000000000..e4955748d3e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml new file mode 100644 index 000000000000..86211e2d4a26 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -0,0 +1,14 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md new file mode 100644 index 000000000000..86cdecf7fd42 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -0,0 +1,216 @@ +# petstore-api +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 Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) +client = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*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 +*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 +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **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 + + +## bearer_test + +- **Type**: Bearer authentication (JWT) + + +## http_basic_test + +- **Type**: HTTP basic authentication + + +## http_signature_test + +- **Type**: HTTP basic authentication + + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..beb2e2d4f1ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **{str: (str,)}** | | [optional] +**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md new file mode 100644 index 000000000000..e59166a62e83 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md @@ -0,0 +1,11 @@ +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..9e19b330e9a9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -0,0 +1,63 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call_123_test_special_tags** +> Client call_123_test_special_tags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +client = petstore_api.Client() # Client | client model + +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md new file mode 100644 index 000000000000..8fc302305abe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..1a68df0090bb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **[[float]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..b8a760f56dc2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **[float]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md new file mode 100644 index 000000000000..c677e324ad47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **[str]** | | [optional] +**array_array_of_integer** | **[[int]]** | | [optional] +**array_array_of_model** | **[[ReadOnlyFirst]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md new file mode 100644 index 000000000000..85d88d239ee7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md @@ -0,0 +1,15 @@ +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md new file mode 100644 index 000000000000..8bdbf9b3bcca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md @@ -0,0 +1,12 @@ +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**declawed** | **bool** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md new file mode 100644 index 000000000000..35434374fc97 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md new file mode 100644 index 000000000000..33b2242d703f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | defaults to 'default-name' +**id** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md new file mode 100644 index 000000000000..657d51a944de --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md @@ -0,0 +1,11 @@ +# ClassModel + +Model for testing model with \"_class\" property +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md new file mode 100644 index 000000000000..88e99384f92c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Client.md @@ -0,0 +1,10 @@ +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md new file mode 100644 index 000000000000..92e27f40a24c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -0,0 +1,56 @@ +# petstore_api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | + + +# **foo_get** +> InlineResponseDefault foo_get() + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.DefaultApi() + +try: + api_response = api_instance.foo_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md new file mode 100644 index 000000000000..81de56780725 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md @@ -0,0 +1,12 @@ +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**breed** | **str** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md new file mode 100644 index 000000000000..36d3216f7b35 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md new file mode 100644 index 000000000000..e0b5582e9d5b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md new file mode 100644 index 000000000000..510dff4df0cf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -0,0 +1,10 @@ +# EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md new file mode 100644 index 000000000000..5e2263ee5e00 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -0,0 +1,17 @@ +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string_required** | **str** | | +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md new file mode 100644 index 000000000000..2b503b7d4d8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -0,0 +1,828 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | + + +# **fake_health_get** +> HealthCheckResult fake_health_get() + +Health check endpoint + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() + +try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[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) + +# **fake_outer_boolean_serialize** +> bool fake_outer_boolean_serialize() + + + +Test serialization of outer boolean types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = True # bool | Input boolean as post body (optional) + +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + +[[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) + +# **fake_outer_composite_serialize** +> OuterComposite fake_outer_composite_serialize() + + + +Test serialization of object with outer number type + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) + +try: + api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + +[[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) + +# **fake_outer_number_serialize** +> float fake_outer_number_serialize() + + + +Test serialization of outer number types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 3.4 # float | Input number as post body (optional) + +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **float**| Input number as post body | [optional] + +### Return type + +**float** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + +[[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) + +# **fake_outer_string_serialize** +> str fake_outer_string_serialize() + + + +Test serialization of outer string types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 'body_example' # str | Input string as post body (optional) + +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| Input string as post body | [optional] + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_file_schema** +> test_body_with_file_schema(file_schema_test_class) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | + +try: + api_instance.test_body_with_file_schema(file_schema_test_class) +except ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_query_params** +> test_body_with_query_params(query, user) + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +query = 'query_example' # str | +user = petstore_api.User() # User | + +try: + api_instance.test_body_with_query_params(query, user) +except ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **str**| | + **user** | [**User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_client_model** +> Client test_client_model(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +client = petstore_api.Client() # Client | client model + +try: + # To test \"client\" model + api_response = api_instance.test_client_model(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +* Basic Authentication (http_basic_test): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure HTTP basic authorization: http_basic_test +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +number = 3.4 # float | None +double = 3.4 # float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None +byte = 'byte_example' # str | None +integer = 56 # int | None (optional) +int32 = 56 # int | None (optional) +int64 = 56 # int | None (optional) +float = 3.4 # float | None (optional) +string = 'string_example' # str | None (optional) +binary = open('/path/to/file', 'rb') # file_type | None (optional) +date = '2013-10-20' # date | None (optional) +date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) +password = 'password_example' # str | None (optional) +param_callback = 'param_callback_example' # str | None (optional) + +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +except ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **file_type**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_enum_parameters** +> test_enum_parameters() + +To test enum parameters + +To test enum parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') +enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') +enum_query_integer = 56 # int | Query parameter enum test (double) (optional) +enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) +enum_form_string_array = '$' # [str] | Form parameter enum test (string array) (optional) (default to '$') +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') + +try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) +except ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | [**[str]**](str.md)| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_string_array** | [**[str]**](str.md)| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | [**[str]**](str.md)| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of '$' + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_group_parameters** +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +* Bearer (JWT) Authentication (bearer_test): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure Bearer authorization (JWT): bearer_test +configuration.access_token = 'YOUR_BEARER_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +required_string_group = 56 # int | Required String in group parameters +required_boolean_group = True # bool | Required Boolean in group parameters +required_int64_group = 56 # int | Required Integer in group parameters +string_group = 56 # int | String in group parameters (optional) +boolean_group = True # bool | Boolean in group parameters (optional) +int64_group = 56 # int | Integer in group parameters (optional) + +try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) +except ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | + **string_group** | **int**| String in group parameters | [optional] + **boolean_group** | **bool**| Boolean in group parameters | [optional] + **int64_group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_inline_additional_properties** +> test_inline_additional_properties(request_body) + +test inline additionalProperties + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +request_body = {'key': 'request_body_example'} # {str: (str,)} | request body + +try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) +except ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | [**{str: (str,)}**](str.md)| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +param = 'param_example' # str | field1 +param2 = 'param2_example' # str | field2 + +try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) +except ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **str**| field1 | + **param2** | **str**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # [str] | +ioutil = ['ioutil_example'] # [str] | +http = ['http_example'] # [str] | +url = ['url_example'] # [str] | +context = ['context_example'] # [str] | + +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**[str]**](str.md)| | + **ioutil** | [**[str]**](str.md)| | + **http** | [**[str]**](str.md)| | + **url** | [**[str]**](str.md)| | + **context** | [**[str]**](str.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..de59ba0d374f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -0,0 +1,71 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> Client test_classname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +* Api Key Authentication (api_key_query): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key_query +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) +client = petstore_api.Client() # Client | client model + +try: + # To test class name in snake case + api_response = api_instance.test_classname(client) + pprint(api_response) +except ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md new file mode 100644 index 000000000000..f17ba0057d04 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/File.md @@ -0,0 +1,11 @@ +# File + +Must be named `File` for test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **str** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..d0a8bbaaba95 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**File**](File.md) | | [optional] +**files** | [**[File]**](File.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md new file mode 100644 index 000000000000..5b281fa08de7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md @@ -0,0 +1,10 @@ +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] if omitted the server will use the default value of 'bar' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md new file mode 100644 index 000000000000..2ac0ffb36d33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md @@ -0,0 +1,24 @@ +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | | +**byte** | **str** | | +**date** | **date** | | +**password** | **str** | | +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**binary** | **file_type** | | [optional] +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..f731a42eab54 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**foo** | **str** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md new file mode 100644 index 000000000000..50cf84f69133 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md @@ -0,0 +1,11 @@ +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullable_message** | **str, none_type** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md new file mode 100644 index 000000000000..f567ea188ce0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the pet | [optional] +**status** | **str** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md new file mode 100644 index 000000000000..4349ad73e3b7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **str** | Additional data to pass to server | [optional] +**file** | **file_type** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md new file mode 100644 index 000000000000..106488e8598e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md @@ -0,0 +1,11 @@ +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md new file mode 100644 index 000000000000..7a73a2c686b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md @@ -0,0 +1,23 @@ +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | None | +**double** | **float** | None | +**pattern_without_delimiter** | **str** | None | +**byte** | **str** | None | +**integer** | **int** | None | [optional] +**int32** | **int** | None | [optional] +**int64** | **int** | None | [optional] +**float** | **float** | None | [optional] +**string** | **str** | None | [optional] +**binary** | **file_type** | None | [optional] +**date** | **date** | None | [optional] +**date_time** | **datetime** | None | [optional] +**password** | **str** | None | [optional] +**callback** | **str** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md new file mode 100644 index 000000000000..07574d0d0769 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md @@ -0,0 +1,11 @@ +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **str** | field1 | +**param2** | **str** | field2 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md new file mode 100644 index 000000000000..8f8662c434db --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md @@ -0,0 +1,11 @@ +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**required_file** | **file_type** | file to upload | +**additional_metadata** | **str** | Additional data to pass to server | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..9c754420f24a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-experimental/docs/List.md new file mode 100644 index 000000000000..11f4f3a05f32 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/List.md @@ -0,0 +1,10 @@ +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md new file mode 100644 index 000000000000..ad561b7220bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md @@ -0,0 +1,13 @@ +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] +**map_of_enum_string** | **{str: (str,)}** | | [optional] +**direct_map** | **{str: (bool,)}** | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..1484c0638d83 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md new file mode 100644 index 000000000000..40d0d7828e14 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md @@ -0,0 +1,12 @@ +# Model200Response + +Model for testing model name starting with number +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md new file mode 100644 index 000000000000..65ec73ddae78 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md @@ -0,0 +1,11 @@ +# ModelReturn + +Model for testing reserved words +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md new file mode 100644 index 000000000000..807b76afc6ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Name.md @@ -0,0 +1,14 @@ +# Name + +Model for testing model name same as property name +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] [readonly] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md new file mode 100644 index 000000000000..8d6bd66098bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md @@ -0,0 +1,22 @@ +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer_prop** | **int, none_type** | | [optional] +**number_prop** | **float, none_type** | | [optional] +**boolean_prop** | **bool, none_type** | | [optional] +**string_prop** | **str, none_type** | | [optional] +**date_prop** | **date, none_type** | | [optional] +**datetime_prop** | **datetime, none_type** | | [optional] +**array_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str], none_type** | | [optional] +**array_and_items_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str, none_type], none_type** | | [optional] +**array_items_nullable** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [optional] +**object_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str,)}, none_type** | | [optional] +**object_and_items_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**object_items_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md new file mode 100644 index 000000000000..93a0fde7b931 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md new file mode 100644 index 000000000000..c21210a3bd59 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] if omitted the server will use the default value of False + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md new file mode 100644 index 000000000000..bab07ad559eb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | **float** | | [optional] +**my_string** | **str** | | [optional] +**my_boolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md new file mode 100644 index 000000000000..7ddfca906e90 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md @@ -0,0 +1,10 @@ +# OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str, none_type** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..2d5a02f98f38 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md @@ -0,0 +1,10 @@ +# OuterEnumDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to 'placed' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..21e90bebf945 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md @@ -0,0 +1,10 @@ +# OuterEnumInteger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..e8994703c347 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,10 @@ +# OuterEnumIntegerDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | defaults to 0 + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md new file mode 100644 index 000000000000..ce09d401c899 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**photo_urls** | **[str]** | | +**id** | **int** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**[Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md new file mode 100644 index 000000000000..0c5c6364803c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -0,0 +1,563 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**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) + + +# **add_pet** +> add_pet(pet) + +Add a new pet to the store + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Add a new pet to the store + api_instance.add_pet(pet) +except ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[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) + +# **delete_pet** +> delete_pet(pet_id) + +Deletes a pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | Pet id to delete +api_key = 'api_key_example' # str | (optional) + +try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) +except ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid pet value | - | + +[[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) + +# **find_pets_by_status** +> [Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +status = ['status_example'] # [str] | Status values that need to be considered for filter + +try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**[str]**](str.md)| Status values that need to be considered for filter | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + +[[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) + +# **find_pets_by_tags** +> [Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +tags = ['tags_example'] # [str] | Tags to filter by + +try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**[str]**](str.md)| Tags to filter by | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + +[[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) + +# **get_pet_by_id** +> Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to return + +try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + +[[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) + +Update an existing pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store + +try: + # Update an existing pet + api_instance.update_pet(pet) +except ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + +[[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_with_form** +> update_pet_with_form(pet_id) + +Updates a pet in the store with form data + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet that needs to be updated +name = 'name_example' # str | Updated name of the pet (optional) +status = 'status_example' # str | Updated status of the pet (optional) + +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) +except ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[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) + +# **upload_file** +> ApiResponse upload_file(pet_id) + +uploads an image + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +file = open('/path/to/file', 'rb') # file_type | file to upload (optional) + +try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file_type**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **upload_file_with_required_file** +> ApiResponse upload_file_with_required_file(pet_id, required_file) + +uploads an image (required) + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +required_file = open('/path/to/file', 'rb') # file_type | file to upload +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) + +try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) +except ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **required_file** | **file_type**| file to upload | + **additional_metadata** | **str**| 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 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..6bc1447c1d71 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**baz** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md new file mode 100644 index 000000000000..022ee19169ce --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md new file mode 100644 index 000000000000..3ffdb4942432 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -0,0 +1,233 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**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/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 'order_id_example' # str | ID of the order that needs to be deleted + +try: + # Delete purchase order by ID + api_instance.delete_order(order_id) +except ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[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) + +# **get_inventory** +> {str: (int,)} get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) + +try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**{str: (int,)}** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **get_order_by_id** +> Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 56 # int | ID of pet that needs to be fetched + +try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[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** +> Order place_order(order) + +Place an order for a pet + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order = petstore_api.Order() # Order | order placed for purchasing the pet + +try: + # Place an order for a pet + api_response = api_instance.place_order(order) + pprint(api_response) +except ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md new file mode 100644 index 000000000000..2fbf3b3767d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -0,0 +1,10 @@ +# StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md new file mode 100644 index 000000000000..243cd98eda69 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md new file mode 100644 index 000000000000..443ac123fdca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md new file mode 100644 index 000000000000..b5b208e87bb2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -0,0 +1,437 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user = petstore_api.User() # User | Created user object + +try: + # Create user + api_instance.create_user(user) +except ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user = [petstore_api.User()] # [User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(user) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user = [petstore_api.User()] # [User] | List of user object + +try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(user) +except ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**[User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be deleted + +try: + # Delete user + api_instance.delete_user(username) +except ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[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) + +# **get_user_by_name** +> User get_user_by_name(username) + +Get user by user name + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + +try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[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) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The user name for login +password = 'password_example' # str | The password for login in clear text + +try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) +except ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +**400** | Invalid username/password supplied | - | + +[[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) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() + +try: + # Logs out current logged in user session + api_instance.logout_user() +except ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | name that need to be deleted +user = petstore_api.User() # User | Updated user object + +try: + # Updated user + api_instance.update_user(username, user) +except ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-experimental/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/git_push.sh @@ -0,0 +1,58 @@ +#!/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" + +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" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +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. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +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 + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +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" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py new file mode 100644 index 000000000000..49b0eeb464ea --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +# flake8: noqa + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0" + +# import apis into sdk package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi + +# import ApiClient +from petstore_api.api_client import ApiClient +from petstore_api.configuration import Configuration +from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiTypeError +from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiKeyError +from petstore_api.exceptions import ApiException +# import models into sdk package +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass +from petstore_api.models.animal import Animal +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly +from petstore_api.models.array_test import ArrayTest +from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat +from petstore_api.models.cat_all_of import CatAllOf +from petstore_api.models.category import Category +from petstore_api.models.class_model import ClassModel +from petstore_api.models.client import Client +from petstore_api.models.dog import Dog +from petstore_api.models.dog_all_of import DogAllOf +from petstore_api.models.enum_arrays import EnumArrays +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.enum_test import EnumTest +from petstore_api.models.file import File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.foo import Foo +from petstore_api.models.format_test import FormatTest +from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inline_object import InlineObject +from petstore_api.models.inline_object1 import InlineObject1 +from petstore_api.models.inline_object2 import InlineObject2 +from petstore_api.models.inline_object3 import InlineObject3 +from petstore_api.models.inline_object4 import InlineObject4 +from petstore_api.models.inline_object5 import InlineObject5 +from petstore_api.models.inline_response_default import InlineResponseDefault +from petstore_api.models.list import List +from petstore_api.models.map_test import MapTest +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.models.model200_response import Model200Response +from petstore_api.models.model_return import ModelReturn +from petstore_api.models.name import Name +from petstore_api.models.nullable_class import NullableClass +from petstore_api.models.number_only import NumberOnly +from petstore_api.models.order import Order +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue +from petstore_api.models.pet import Pet +from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap +from petstore_api.models.tag import Tag +from petstore_api.models.user import User + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py new file mode 100644 index 000000000000..fa4e54a80091 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -0,0 +1,12 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py new file mode 100644 index 000000000000..89594ed2adbc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -0,0 +1,375 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.client import Client + + +class AnotherFakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __call_123_test_special_tags(self, client, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.call_123_test_special_tags(client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Client client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client'] = client + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [], + 'endpoint_path': '/another-fake/dummy', + 'operation_id': 'call_123_test_special_tags', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client', + ], + 'required': [ + 'client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client': (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__call_123_test_special_tags + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py new file mode 100644 index 000000000000..bbd4f2584287 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -0,0 +1,365 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.inline_response_default import InlineResponseDefault + + +class DefaultApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __foo_get(self, **kwargs): # noqa: E501 + """foo_get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.foo_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: InlineResponseDefault + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.foo_get = Endpoint( + settings={ + 'response_type': (InlineResponseDefault,), + 'auth': [], + 'endpoint_path': '/foo', + 'operation_id': 'foo_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__foo_get + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py new file mode 100644 index 000000000000..a50900f88f99 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -0,0 +1,2016 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.client import Client +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.user import User + + +class FakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __fake_health_get(self, **kwargs): # noqa: E501 + """Health check endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_health_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: HealthCheckResult + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_health_get = Endpoint( + settings={ + 'response_type': (HealthCheckResult,), + 'auth': [], + 'endpoint_path': '/fake/health', + 'operation_id': 'fake_health_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_health_get + ) + + def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param bool body: Input boolean as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_boolean_serialize = Endpoint( + settings={ + 'response_type': (bool,), + 'auth': [], + 'endpoint_path': '/fake/outer/boolean', + 'operation_id': 'fake_outer_boolean_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': (bool,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_boolean_serialize + ) + + def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param OuterComposite outer_composite: Input composite as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: OuterComposite + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_composite_serialize = Endpoint( + settings={ + 'response_type': (OuterComposite,), + 'auth': [], + 'endpoint_path': '/fake/outer/composite', + 'operation_id': 'fake_outer_composite_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'outer_composite', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'outer_composite': (OuterComposite,), + }, + 'attribute_map': { + }, + 'location_map': { + 'outer_composite': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_composite_serialize + ) + + def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float body: Input number as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: float + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_number_serialize = Endpoint( + settings={ + 'response_type': (float,), + 'auth': [], + 'endpoint_path': '/fake/outer/number', + 'operation_id': 'fake_outer_number_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': (float,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_number_serialize + ) + + def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str body: Input string as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_string_serialize = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/fake/outer/string', + 'operation_id': 'fake_outer_string_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': (str,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_string_serialize + ) + + def __test_body_with_file_schema(self, file_schema_test_class, **kwargs): # noqa: E501 + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param FileSchemaTestClass file_schema_test_class: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['file_schema_test_class'] = file_schema_test_class + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-file-schema', + 'operation_id': 'test_body_with_file_schema', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'file_schema_test_class', + ], + 'required': [ + 'file_schema_test_class', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'file_schema_test_class': (FileSchemaTestClass,), + }, + 'attribute_map': { + }, + 'location_map': { + 'file_schema_test_class': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_file_schema + ) + + def __test_body_with_query_params(self, query, user, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_query_params(query, user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str query: (required) + :param User user: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['query'] = query + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-query-params', + 'operation_id': 'test_body_with_query_params', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'query', + 'user', + ], + 'required': [ + 'query', + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'query': (str,), + 'user': (User,), + }, + 'attribute_map': { + 'query': 'query', + }, + 'location_map': { + 'query': 'query', + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_query_params + ) + + def __test_client_model(self, client, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Client client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client'] = client + return self.call_with_http_info(**kwargs) + + self.test_client_model = Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_client_model', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client', + ], + 'required': [ + 'client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client': (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_client_model + ) + + def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param file_type binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['number'] = number + kwargs['double'] = double + kwargs['pattern_without_delimiter'] = pattern_without_delimiter + kwargs['byte'] = byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'http_basic_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_endpoint_parameters', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + 'integer', + 'int32', + 'int64', + 'float', + 'string', + 'binary', + 'date', + 'date_time', + 'password', + 'param_callback', + ], + 'required': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'integer', + 'int32', + 'float', + 'string', + 'password', + ] + }, + root_map={ + 'validations': { + ('number',): { + + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + + 'inclusive_maximum': 987.6, + }, + ('string',): { + + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'number': (float,), + 'double': (float,), + 'pattern_without_delimiter': (str,), + 'byte': (str,), + 'integer': (int,), + 'int32': (int,), + 'int64': (int,), + 'float': (float,), + 'string': (str,), + 'binary': (file_type,), + 'date': (date,), + 'date_time': (datetime,), + 'password': (str,), + 'param_callback': (str,), + }, + 'attribute_map': { + 'number': 'number', + 'double': 'double', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'float': 'float', + 'string': 'string', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'param_callback': 'callback', + }, + 'location_map': { + 'number': 'form', + 'double': 'form', + 'pattern_without_delimiter': 'form', + 'byte': 'form', + 'integer': 'form', + 'int32': 'form', + 'int64': 'form', + 'float': 'form', + 'string': 'form', + 'binary': 'form', + 'date': 'form', + 'date_time': 'form', + 'password': 'form', + 'param_callback': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_endpoint_parameters + ) + + def __test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param [str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :param [str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_enum_parameters', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('enum_header_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_header_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_query_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_integer',): { + + "1": 1, + "-2": -2 + }, + ('enum_query_double',): { + + "1.1": 1.1, + "-1.2": -1.2 + }, + ('enum_form_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_form_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + }, + 'openapi_types': { + 'enum_header_string_array': ([str],), + 'enum_header_string': (str,), + 'enum_query_string_array': ([str],), + 'enum_query_string': (str,), + 'enum_query_integer': (int,), + 'enum_query_double': (float,), + 'enum_form_string_array': ([str],), + 'enum_form_string': (str,), + }, + 'attribute_map': { + 'enum_header_string_array': 'enum_header_string_array', + 'enum_header_string': 'enum_header_string', + 'enum_query_string_array': 'enum_query_string_array', + 'enum_query_string': 'enum_query_string', + 'enum_query_integer': 'enum_query_integer', + 'enum_query_double': 'enum_query_double', + 'enum_form_string_array': 'enum_form_string_array', + 'enum_form_string': 'enum_form_string', + }, + 'location_map': { + 'enum_header_string_array': 'header', + 'enum_header_string': 'header', + 'enum_query_string_array': 'query', + 'enum_query_string': 'query', + 'enum_query_integer': 'query', + 'enum_query_double': 'query', + 'enum_form_string_array': 'form', + 'enum_form_string': 'form', + }, + 'collection_format_map': { + 'enum_header_string_array': 'csv', + 'enum_query_string_array': 'multi', + 'enum_form_string_array': 'csv', + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_enum_parameters + ) + + def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int required_string_group: Required String in group parameters (required) + :param bool required_boolean_group: Required Boolean in group parameters (required) + :param int required_int64_group: Required Integer in group parameters (required) + :param int string_group: String in group parameters + :param bool boolean_group: Boolean in group parameters + :param int int64_group: Integer in group parameters + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['required_string_group'] = required_string_group + kwargs['required_boolean_group'] = required_boolean_group + kwargs['required_int64_group'] = required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'bearer_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_group_parameters', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + 'string_group', + 'boolean_group', + 'int64_group', + ], + 'required': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'required_string_group': (int,), + 'required_boolean_group': (bool,), + 'required_int64_group': (int,), + 'string_group': (int,), + 'boolean_group': (bool,), + 'int64_group': (int,), + }, + 'attribute_map': { + 'required_string_group': 'required_string_group', + 'required_boolean_group': 'required_boolean_group', + 'required_int64_group': 'required_int64_group', + 'string_group': 'string_group', + 'boolean_group': 'boolean_group', + 'int64_group': 'int64_group', + }, + 'location_map': { + 'required_string_group': 'query', + 'required_boolean_group': 'header', + 'required_int64_group': 'query', + 'string_group': 'query', + 'boolean_group': 'header', + 'int64_group': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_group_parameters + ) + + def __test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(request_body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param {str: (str,)} request_body: request body (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['request_body'] = request_body + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/inline-additionalProperties', + 'operation_id': 'test_inline_additional_properties', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'request_body', + ], + 'required': [ + 'request_body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'request_body': ({str: (str,)},), + }, + 'attribute_map': { + }, + 'location_map': { + 'request_body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_inline_additional_properties + ) + + def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str param: field1 (required) + :param str param2: field2 (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['param'] = param + kwargs['param2'] = param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/jsonFormData', + 'operation_id': 'test_json_form_data', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'param', + 'param2', + ], + 'required': [ + 'param', + 'param2', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': (str,), + 'param2': (str,), + }, + 'attribute_map': { + 'param': 'param', + 'param2': 'param2', + }, + 'location_map': { + 'param': 'form', + 'param2': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_json_form_data + ) + + def __test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] pipe: (required) + :param [str] ioutil: (required) + :param [str] http: (required) + :param [str] url: (required) + :param [str] context: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pipe'] = pipe + kwargs['ioutil'] = ioutil + kwargs['http'] = http + kwargs['url'] = url + kwargs['context'] = context + return self.call_with_http_info(**kwargs) + + self.test_query_parameter_collection_format = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/test-query-paramters', + 'operation_id': 'test_query_parameter_collection_format', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'required': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pipe': ([str],), + 'ioutil': ([str],), + 'http': ([str],), + 'url': ([str],), + 'context': ([str],), + }, + 'attribute_map': { + 'pipe': 'pipe', + 'ioutil': 'ioutil', + 'http': 'http', + 'url': 'url', + 'context': 'context', + }, + 'location_map': { + 'pipe': 'query', + 'ioutil': 'query', + 'http': 'query', + 'url': 'query', + 'context': 'query', + }, + 'collection_format_map': { + 'pipe': 'multi', + 'ioutil': 'csv', + 'http': 'space', + 'url': 'csv', + 'context': 'multi', + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_query_parameter_collection_format + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py new file mode 100644 index 000000000000..e4e38865cad5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -0,0 +1,377 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.client import Client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __test_classname(self, client, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Client client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client'] = client + return self.call_with_http_info(**kwargs) + + self.test_classname = Endpoint( + settings={ + 'response_type': (Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client', + ], + 'required': [ + 'client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client': (Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_classname + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py new file mode 100644 index 000000000000..da5c4a261249 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -0,0 +1,1292 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.pet import Pet + + +class PetApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __add_pet(self, pet, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Pet pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet'] = pet + return self.call_with_http_info(**kwargs) + + self.add_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'add_pet', + 'http_method': 'POST', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet', + ], + 'required': [ + 'pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet': (Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__add_pet + ) + + def __delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: Pet id to delete (required) + :param str api_key: + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'delete_pet', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'api_key', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'api_key': (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'api_key': 'api_key', + }, + 'location_map': { + 'pet_id': 'path', + 'api_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_pet + ) + + def __find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] status: Status values that need to be considered for filter (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['status'] = status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = Endpoint( + settings={ + 'response_type': ([Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByStatus', + 'operation_id': 'find_pets_by_status', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'status', + ], + 'required': [ + 'status', + ], + 'nullable': [ + ], + 'enum': [ + 'status', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('status',): { + + "AVAILABLE": "available", + "PENDING": "pending", + "SOLD": "sold" + }, + }, + 'openapi_types': { + 'status': ([str],), + }, + 'attribute_map': { + 'status': 'status', + }, + 'location_map': { + 'status': 'query', + }, + 'collection_format_map': { + 'status': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_status + ) + + def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] tags: Tags to filter by (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['tags'] = tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = Endpoint( + settings={ + 'response_type': ([Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByTags', + 'operation_id': 'find_pets_by_tags', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'tags', + ], + 'required': [ + 'tags', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tags': ([str],), + }, + 'attribute_map': { + 'tags': 'tags', + }, + 'location_map': { + 'tags': 'query', + }, + 'collection_format_map': { + 'tags': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_tags + ) + + def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to return (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = Endpoint( + settings={ + 'response_type': (Pet,), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'get_pet_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + }, + 'attribute_map': { + 'pet_id': 'petId', + }, + 'location_map': { + 'pet_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_pet_by_id + ) + + def __update_pet(self, pet, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Pet pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet'] = pet + return self.call_with_http_info(**kwargs) + + self.update_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'update_pet', + 'http_method': 'PUT', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet', + ], + 'required': [ + 'pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet': (Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__update_pet + ) + + def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'update_pet_with_form', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'name', + 'status', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'name': (str,), + 'status': (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'name': 'name', + 'status': 'status', + }, + 'location_map': { + 'pet_id': 'path', + 'name': 'form', + 'status': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__update_pet_with_form + ) + + def __upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file_type file: file to upload + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = Endpoint( + settings={ + 'response_type': (ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}/uploadImage', + 'operation_id': 'upload_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'additional_metadata', + 'file', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'additional_metadata': (str,), + 'file': (file_type,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'additional_metadata': 'additionalMetadata', + 'file': 'file', + }, + 'location_map': { + 'pet_id': 'path', + 'additional_metadata': 'form', + 'file': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file + ) + + def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param file_type required_file: file to upload (required) + :param str additional_metadata: Additional data to pass to server + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = pet_id + kwargs['required_file'] = required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = Endpoint( + settings={ + 'response_type': (ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', + 'operation_id': 'upload_file_with_required_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'required_file', + 'additional_metadata', + ], + 'required': [ + 'pet_id', + 'required_file', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': (int,), + 'required_file': (file_type,), + 'additional_metadata': (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'required_file': 'requiredFile', + 'additional_metadata': 'additionalMetadata', + }, + 'location_map': { + 'pet_id': 'path', + 'required_file': 'form', + 'additional_metadata': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file_with_required_file + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py new file mode 100644 index 000000000000..ee9baec15d5e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -0,0 +1,692 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.order import Order + + +class StoreApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str order_id: ID of the order that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'delete_order', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': (str,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_order + ) + + def __get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.get_inventory = Endpoint( + settings={ + 'response_type': ({str: (int,)},), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/store/inventory', + 'operation_id': 'get_inventory', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_inventory + ) + + def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int order_id: ID of pet that needs to be fetched (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = Endpoint( + settings={ + 'response_type': (Order,), + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'get_order_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'order_id', + ] + }, + root_map={ + 'validations': { + ('order_id',): { + + 'inclusive_maximum': 5, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': (int,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_order_by_id + ) + + def __place_order(self, order, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(order, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param Order order: order placed for purchasing the pet (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order'] = order + return self.call_with_http_info(**kwargs) + + self.place_order = Endpoint( + settings={ + 'response_type': (Order,), + 'auth': [], + 'endpoint_path': '/store/order', + 'operation_id': 'place_order', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'order', + ], + 'required': [ + 'order', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order': (Order,), + }, + 'attribute_map': { + }, + 'location_map': { + 'order': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__place_order + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py new file mode 100644 index 000000000000..03b3226119df --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -0,0 +1,1111 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models.user import User + + +class UserApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __create_user(self, user, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param User user: Created user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.create_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user', + 'operation_id': 'create_user', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user', + ], + 'required': [ + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user': (User,), + }, + 'attribute_map': { + }, + 'location_map': { + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_user + ) + + def __create_users_with_array_input(self, user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [User] user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithArray', + 'operation_id': 'create_users_with_array_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user', + ], + 'required': [ + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user': ([User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_array_input + ) + + def __create_users_with_list_input(self, user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [User] user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithList', + 'operation_id': 'create_users_with_list_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user', + ], + 'required': [ + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user': ([User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_list_input + ) + + def __delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + return self.call_with_http_info(**kwargs) + + self.delete_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'delete_user', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_user + ) + + def __get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = Endpoint( + settings={ + 'response_type': (User,), + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'get_user_by_name', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_user_by_name + ) + + def __login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + kwargs['password'] = password + return self.call_with_http_info(**kwargs) + + self.login_user = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/user/login', + 'operation_id': 'login_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'password', + ], + 'required': [ + 'username', + 'password', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + 'password': (str,), + }, + 'attribute_map': { + 'username': 'username', + 'password': 'password', + }, + 'location_map': { + 'username': 'query', + 'password': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__login_user + ) + + def __logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.logout_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/logout', + 'operation_id': 'logout_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__logout_user + ) + + def __update_user(self, username, user, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(username, user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: name that need to be deleted (required) + :param User user: Updated user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = username + kwargs['user'] = user + return self.call_with_http_info(**kwargs) + + self.update_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'update_user', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'user', + ], + 'required': [ + 'username', + 'user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': (str,), + 'user': (User,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + 'user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__update_user + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py new file mode 100644 index 000000000000..2fc2090d9488 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -0,0 +1,698 @@ +# coding: utf-8 +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote, urlencode, urlparse +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from Crypto.Hash import SHA256, SHA512 +from base64 import b64encode + +from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.exceptions import ApiValueError +from petstore_api.model_utils import ( + ModelNormal, + ModelSimple, + date, + datetime, + deserialize_file, + file_type, + model_to_dict, + str, + validate_and_convert_types +) + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + # six.binary_type python2=str, python3=bytes + # six.text_type python2=unicode, python3=str + PRIMITIVE_TYPES = ( + (float, bool, six.binary_type, six.text_type) + six.integer_types + ) + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + elif isinstance(obj, ModelNormal): + # Convert model obj to dict + # Convert attribute name to json key in + # model definition for request + obj_dict = model_to_dict(obj, serialize=True) + elif isinstance(obj, ModelSimple): + return self.sanitize_for_serialization(obj.value) + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type, _check_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param _check_type: boolean, whether to check the types of the data + received from the server + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == (file_type,): + content_disposition = response.getheader("Content-Disposition") + return deserialize_file(response.data, self.configuration, + content_disposition=content_disposition) + + # fetch data from response object + try: + received_data = json.loads(response.data) + except ValueError: + received_data = response.data + + # store our data under the key of 'received_data' so users have some + # context if they are deserializing a string and the data type is wrong + deserialized_data = validate_and_convert_types( + received_data, + response_type, + ['received_data'], + True, + _check_type, + configuration=self.configuration + ) + return deserialized_data + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param files dict: key -> field name, value -> a list of open file + objects for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _check_type: boolean describing if the data back from the server + should have its type checked. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _check_type) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: None or a dict with key=param_name and + value is a list of open file objects + :return: List of tuples of form parameters with file data + """ + if files is None: + return [] + + params = [] + for param_name, file_instances in six.iteritems(files): + if file_instances is None: + # if the file field is nullable, skip None values + continue + for file_instance in file_instances: + if file_instance is None: + # if the file field is nullable, skip None values + continue + if file_instance.closed is True: + raise ApiValueError( + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name + ) + filename = os.path.basename(file_instance.name) + filedata = file_instance.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([param_name, tuple([filename, filedata, mimetype])])) + file_instance.close() + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: The HTTP request resource path. + :method: The HTTP request method. + :body: The body of the HTTP request. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['type'] == 'http-signature': + # The HTTP signature scheme requires multiple HTTP headers that are calculated dynamically. + auth_headers = self.get_http_signature_headers(resource_path, method, headers, body, querys) + for key, value in auth_headers.items(): + headers[key] = value + continue + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """ + Create a message signature for the HTTP request and add the signed headers. + + :param resource_path : resource path which is the api being called upon. + :param method: the HTTP request method. + :param headers: the request headers. + :param body: body passed in the http request. + :param query_params: query parameters used by the API + :return: instance of digest object + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + if body is None: + body = '' + else: + body = json.dumps(body) + + target_host = urlparse(self.configuration.host).netloc + target_path = urlparse(self.configuration.host).path + + request_target = method.lower() + " " + target_path + resource_path + + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query + + from email.utils import formatdate + cdate=formatdate(timeval=None, localtime=False, usegmt=True) + + request_body = body.encode() + body_digest, digest_prefix = self.get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + + signed_headers = { + 'Date': cdate, + 'Host': target_host, + 'Digest': digest_prefix + b64_body_digest.decode('ascii') + } + for hdr_key in self.configuration.signed_headers: + signed_headers[hdr_key] = headers[hdr_key] + + string_to_sign = self.get_str_to_sign(request_target, signed_headers) + + digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) + b64_signed_msg = self.sign_digest(digest) + + auth_header = self.get_authorization_header(signed_headers, b64_signed_msg) + + return { + 'Date': '{0}'.format(cdate), + 'Host': '{0}'.format(target_host), + 'Digest': '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')), + 'Authorization': '{0}'.format(auth_header) + } + + def get_message_digest(self, data): + """ + Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The message to be hashed with a cryptographic hash. + :return: The message digest encoded as a byte string. + """ + if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: + digest = SHA512.new() + prefix = "SHA-512=" + elif self.configuration.signing_scheme in ["rsa-sha256"]: + digest = SHA256.new() + prefix = "SHA-256=" + else: + raise Exception("Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) + digest.update(data) + return digest, prefix + + def sign_digest(self, digest): + """ + Signs a message digest with a private key specified in the configuration. + + :param digest: digest of the HTTP message. + :return: the HTTP message signature encoded as a byte string. + """ + self.configuration.load_private_key() + privkey = self.configuration.private_key + if isinstance(privkey, RSA.RsaKey): + if self.configuration.signing_algorithm == 'PSS': + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(privkey).sign(digest) + elif self.configuration.signing_algorithm == 'PKCS1-v1_5': + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(privkey).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + elif isinstance(privkey, ECC.EccKey): + if self.configuration.signing_algorithm in ['fips-186-3', 'deterministic-rfc6979']: + signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + else: + raise Exception("Unsupported private key: {0}".format(type(privkey))) + return b64encode(signature) + + def get_str_to_sign(self, req_tgt, hdrs): + """ + Generate and return a string value representing the HTTP request to be signed. + + :param req_tgt : Request Target as stored in http header. + :param hdrs: HTTP Headers to be signed. + :return: instance of digest object + """ + ss = "" + ss = ss + "(request-target): " + req_tgt + "\n" + + length = len(hdrs.items()) + + i = 0 + for key, value in hdrs.items(): + ss = ss + key.lower() + ": " + value + if i < length-1: + ss = ss + "\n" + i += 1 + + return ss + + def get_authorization_header(self, hdrs, signed_msg): + """ + Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param hdrs : The list of signed HTTP Headers + :param signed_msg: Signed Digest + :return: instance of digest object + """ + + auth_str = "" + auth_str = auth_str + "Signature" + + auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" + + for key, _ in hdrs.items(): + auth_str = auth_str + " " + key.lower() + auth_str = auth_str + "\"" + + auth_str = auth_str + "," + "signature=\"" + signed_msg.decode('ascii') + "\"" + + return auth_str + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py new file mode 100644 index 000000000000..5b100fcff6c8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -0,0 +1,436 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import logging +import multiprocessing +import pem +from Crypto.PublicKey import RSA, ECC +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s) + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests + :param private_key_path: The path of the file containing a private key, when signing HTTP requests + :param signing_scheme: The signature scheme, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests + """ + + def __init__(self, host="http://petstore.swagger.io:80/v2", + api_key=None, api_key_prefix=None, + username="", password="", + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): + """Constructor + """ + self.host = host + """Default Base url + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests. + """ + self.access_token = "" + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.private_key = None + """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Disable client side validation + self.client_side_validation = True + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'api_key': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + }, + 'api_key_query': + { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + }, + 'bearer_test': + { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + 'http_basic_test': + { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + }, + 'http_signature_test': + { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + }, + 'petstore_auth': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + } + + def load_private_key(self): + """Load the private key used to sign HTTP requests. + """ + if self.private_key is not None: + return + with open(self.private_key_path, "rb") as f: + # Decode PEM file and determine key type from PEM header. + # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". + keys = pem.parse(f.read()) + if len(keys) != 1: + raise Exception("File must contain exactly one private key") + key = keys[0].as_text() + if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): + self.private_key = RSA.importKey(key) + elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): + self.private_key = ECC.importKey(key) + else: + raise Exception("Unsupported key") + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://{server}.swagger.io:{port}/v2", + 'description': "petstore server", + 'variables': { + 'server': { + 'description': "No description provided", + 'default_value': "petstore", + 'enum_values': [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + 'port': { + 'description': "No description provided", + 'default_value': "80", + 'enum_values': [ + "80", + "8080" + ] + } + } + }, + { + 'url': "https://localhost:8080/{version}", + 'description': "The local server", + 'variables': { + 'version': { + 'description': "No description provided", + 'default_value': "v2", + 'enum_values': [ + "v1", + "v2" + ] + } + } + } + ] + + def get_host_from_settings(self, index, variables={}): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :return: URL based on host settings + """ + + servers = self.get_host_settings() + + # check array index out of bound + if index < 0 or index >= len(servers): + raise ValueError( + "Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501 + .format(index, len(servers))) + + server = servers[index] + url = server['url'] + + # go through variable and assign a value + for variable_name in server['variables']: + if variable_name in variables: + if variables[variable_name] in server['variables'][ + variable_name]['enum_values']: + url = url.replace("{" + variable_name + "}", + variables[variable_name]) + else: + raise ValueError( + "The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501 + .format( + variable_name, variables[variable_name], + server['variables'][variable_name]['enum_values'])) + else: + # use default value + url = url.replace( + "{" + variable_name + "}", + server['variables'][variable_name]['default_value']) + + return url diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py new file mode 100644 index 000000000000..100be3e0540f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py new file mode 100644 index 000000000000..22d9ee459de7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -0,0 +1,876 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import copy +from datetime import date, datetime # noqa: F401 +import inspect +import os +import re +import tempfile + +from dateutil.parser import parse +import six + +from petstore_api.exceptions import ( + ApiKeyError, + ApiTypeError, + ApiValueError, +) + +none_type = type(None) +if six.PY3: + import io + file_type = io.IOBase + # these are needed for when other modules import str and int from here + str = str + int = int +else: + file_type = file # noqa: F821 + str_py2 = str + unicode_py2 = unicode # noqa: F821 + long_py2 = long # noqa: F821 + int_py2 = int + # this requires that the future library is installed + from builtins import int, str + + +class OpenApiModel(object): + """The base class for all OpenAPIModels""" + + +class ModelSimple(OpenApiModel): + """the parent class of models whose type != object in their + swagger/openapi""" + + +class ModelNormal(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi""" + + +COERCION_INDEX_BY_TYPE = { + ModelNormal: 0, + ModelSimple: 1, + none_type: 2, + list: 3, + dict: 4, + float: 5, + int: 6, + bool: 7, + datetime: 8, + date: 9, + str: 10, + file_type: 11, +} + +# these are used to limit what type conversions we try to do +# when we have a valid type already and we want to try converting +# to another type +UPCONVERSION_TYPE_PAIRS = ( + (str, datetime), + (str, date), + (list, ModelNormal), + (dict, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), +) + +COERCIBLE_TYPE_PAIRS = { + False: ( # client instantiation of a model with client data + # (dict, ModelNormal), + # (list, ModelNormal), + # (str, ModelSimple), + # (int, ModelSimple), + # (float, ModelSimple), + # (list, ModelSimple), + # (str, int), + # (str, float), + # (str, datetime), + # (str, date), + # (int, str), + # (float, str), + ), + True: ( # server -> client data + (dict, ModelNormal), + (list, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), + # (str, int), + # (str, float), + (str, datetime), + (str, date), + # (int, str), + # (float, str), + (str, file_type) + ), +} + + +def get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + Python2: + float and int will return int, where int is the python3 int backport + str and unicode will return str, where str is the python3 str backport + Note: float and int ARE both instances of int backport + Note: str_py2 and unicode_py2 are NOT both instances of str backport + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, type): + # input_value is a class + return input_value + elif isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, list): + return list + elif isinstance(input_value, dict): + return dict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, file_type): + return file_type + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + # for python2 input_value==long_instance -> return int + # where int is the python3 int backport + return int + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or + isinstance(input_value, str)): + return str + return type(input_value) + + +def check_allowed_values(allowed_values, input_variable_path, input_values): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + """ + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def check_validations(validations, input_variable_path, input_values): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking + """ + current_validations = validations[input_variable_path] + if ('max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if ('min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if ('max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if ('min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum') + if (any(item in current_validations for item in items)): + if isinstance(input_values, list): + max_val = max(input_values) + min_val = min(input_values) + elif isinstance(input_values, dict): + max_val = max(input_values.values()) + min_val = min(input_values.values()) + else: + max_val = input_values + min_val = input_values + + if ('exclusive_maximum' in current_validations and + max_val >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_maximum' in current_validations and + max_val > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if ('exclusive_minimum' in current_validations and + min_val <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_minimum' in current_validations and + min_val < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if ('regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + raise ApiValueError( + r"Invalid value for `%s`, must be a follow pattern or equal to " + r"`%s` with flags=`%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'], + flags + ) + ) + + +def order_response_types(required_types): + """Returns the required types sorted in coercion order + + Args: + required_types (list/tuple): collection of classes or instance of + list or dict with classs information inside it + + Returns: + (list): coercion order sorted collection of classes or instance + of list or dict with classs information inside it + """ + + def index_getter(class_or_instance): + if isinstance(class_or_instance, list): + return COERCION_INDEX_BY_TYPE[list] + elif isinstance(class_or_instance, dict): + return COERCION_INDEX_BY_TYPE[dict] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelNormal)): + return COERCION_INDEX_BY_TYPE[ModelNormal] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelSimple)): + return COERCION_INDEX_BY_TYPE[ModelSimple] + return COERCION_INDEX_BY_TYPE[class_or_instance] + + sorted_types = sorted( + required_types, + key=lambda class_or_instance: index_getter(class_or_instance) + ) + return sorted_types + + +def remove_uncoercible(required_types_classes, current_item, from_server, + must_convert=True): + """Only keeps the type conversions that are possible + + Args: + required_types_classes (tuple): tuple of classes that are required + these should be ordered by COERCION_INDEX_BY_TYPE + from_server (bool): a boolean of whether the data is from the server + if false, the data is from the client + current_item (any): the current item to be converted + + Keyword Args: + must_convert (bool): if True the item to convert is of the wrong + type and we want a big list of coercibles + if False, we want a limited list of coercibles + + Returns: + (list): the remaining coercible required types, classes only + """ + current_type_simple = get_simple_class(current_item) + + results_classes = [] + for required_type_class in required_types_classes: + # convert our models to OpenApiModel + required_type_class_simplified = required_type_class + if isinstance(required_type_class_simplified, type): + if issubclass(required_type_class_simplified, ModelNormal): + required_type_class_simplified = ModelNormal + elif issubclass(required_type_class_simplified, ModelSimple): + required_type_class_simplified = ModelSimple + + if required_type_class_simplified == current_type_simple: + # don't consider converting to one's own class + continue + + class_pair = (current_type_simple, required_type_class_simplified) + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: + results_classes.append(required_type_class) + elif class_pair in UPCONVERSION_TYPE_PAIRS: + results_classes.append(required_type_class) + return results_classes + + +def get_required_type_classes(required_types_mixed): + """Converts the tuple required_types into a tuple and a dict described + below + + Args: + required_types_mixed (tuple/list): will contain either classes or + instance of list or dict + + Returns: + (valid_classes, dict_valid_class_to_child_types_mixed): + valid_classes (tuple): the valid classes that the current item + should be + dict_valid_class_to_child_types_mixed (doct): + valid_class (class): this is the key + child_types_mixed (list/dict/tuple): describes the valid child + types + """ + valid_classes = [] + child_req_types_by_current_type = {} + for required_type in required_types_mixed: + if isinstance(required_type, list): + valid_classes.append(list) + child_req_types_by_current_type[list] = required_type + elif isinstance(required_type, tuple): + valid_classes.append(tuple) + child_req_types_by_current_type[tuple] = required_type + elif isinstance(required_type, dict): + valid_classes.append(dict) + child_req_types_by_current_type[dict] = required_type[str] + else: + valid_classes.append(required_type) + return tuple(valid_classes), child_req_types_by_current_type + + +def change_keys_js_to_python(input_dict, model_class): + """ + Converts from javascript_key keys in the input_dict to python_keys in + the output dict using the mapping in model_class + """ + + output_dict = {} + reversed_attr_map = {value: key for key, value in + six.iteritems(model_class.attribute_map)} + for javascript_key, value in six.iteritems(input_dict): + python_key = reversed_attr_map.get(javascript_key) + if python_key is None: + # if the key is unknown, it is in error or it is an + # additionalProperties variable + python_key = javascript_key + output_dict[python_key] = value + return output_dict + + +def get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type + ) + + +def deserialize_primitive(data, klass, path_to_item): + """Deserializes string to primitive type. + + :param data: str/int/float + :param klass: str/class the class to convert to + + :return: int, float, str, bool, date, datetime + """ + additional_message = "" + try: + if klass in {datetime, date}: + additional_message = ( + "If you need your parameter to have a fallback " + "string value, please set its type as `type: {}` in your " + "spec. That allows the value to be any type. " + ) + if klass == datetime: + if len(data) < 8: + raise ValueError("This is not a datetime") + # The string should be in iso8601 datetime format. + parsed_datetime = parse(data) + date_only = ( + parsed_datetime.hour == 0 and + parsed_datetime.minute == 0 and + parsed_datetime.second == 0 and + parsed_datetime.tzinfo is None and + 8 <= len(data) <= 10 + ) + if date_only: + raise ValueError("This is a date, not a datetime") + return parsed_datetime + elif klass == date: + if len(data) < 8: + raise ValueError("This is not a date") + return parse(data).date() + else: + converted_value = klass(data) + if isinstance(data, str) and klass == float: + if str(converted_value) != data: + # '7' -> 7.0 -> '7.0' != '7' + raise ValueError('This is not a float') + return converted_value + except (OverflowError, ValueError): + # parse can raise OverflowError + raise ApiValueError( + "{0}Failed to parse {1} as {2}".format( + additional_message, repr(data), get_py3_class_name(klass) + ), + path_to_item=path_to_item + ) + + +def deserialize_model(model_data, model_class, path_to_item, check_type, + configuration, from_server): + """Deserializes model_data to model instance. + + Args: + model_data (list/dict): data to instantiate the model + model_class (OpenApiModel): the model class + path_to_item (list): path to the model in the received data + check_type (bool): whether to check the data tupe for the values in + the model + configuration (Configuration): the instance to use to convert files + from_server (bool): True if the data is from the server + False if the data is from the client + + Returns: + model instance + + Raise: + ApiTypeError + ApiValueError + ApiKeyError + """ + fixed_model_data = copy.deepcopy(model_data) + + if isinstance(fixed_model_data, dict): + fixed_model_data = change_keys_js_to_python(fixed_model_data, + model_class) + + kw_args = dict(_check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _from_server=from_server) + + if hasattr(model_class, 'get_real_child_model'): + # discriminator case + discriminator_class = model_class.get_real_child_model(model_data) + if discriminator_class: + if isinstance(model_data, list): + instance = discriminator_class(*model_data, **kw_args) + elif isinstance(model_data, dict): + fixed_model_data = change_keys_js_to_python( + fixed_model_data, + discriminator_class + ) + kw_args.update(fixed_model_data) + instance = discriminator_class(**kw_args) + else: + # all other cases + if isinstance(model_data, list): + instance = model_class(*model_data, **kw_args) + if isinstance(model_data, dict): + fixed_model_data = change_keys_js_to_python(fixed_model_data, + model_class) + kw_args.update(fixed_model_data) + instance = model_class(**kw_args) + else: + instance = model_class(model_data, **kw_args) + + return instance + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if six.PY3 and isinstance(response_data, str): + # in python3 change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +def attempt_convert_item(input_value, valid_classes, path_to_item, + configuration, from_server, key_type=False, + must_convert=False, check_type=True): + """ + Args: + input_value (any): the data to convert + valid_classes (any): the classes that are valid + path_to_item (list): the path to the item to convert + configuration (Configuration): the instance to use to convert files + from_server (bool): True if data is from the server, False is data is + from the client + key_type (bool): if True we need to convert a key type (not supported) + must_convert (bool): if True we must convert + check_type (bool): if True we check the type or the returned data in + ModelNormal and ModelSimple instances + + Returns: + instance (any) the fixed item + + Raises: + ApiTypeError + ApiValueError + ApiKeyError + """ + valid_classes_ordered = order_response_types(valid_classes) + valid_classes_coercible = remove_uncoercible( + valid_classes_ordered, input_value, from_server) + if not valid_classes_coercible or key_type: + # we do not handle keytype errors, json will take care + # of this for us + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=key_type) + for valid_class in valid_classes_coercible: + try: + if issubclass(valid_class, OpenApiModel): + return deserialize_model(input_value, valid_class, + path_to_item, check_type, + configuration, from_server) + elif valid_class == file_type: + return deserialize_file(input_value, configuration) + return deserialize_primitive(input_value, valid_class, + path_to_item) + except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: + if must_convert: + raise conversion_exc + # if we have conversion errors when must_convert == False + # we ignore the exception and move on to the next class + continue + # we were unable to convert, must_convert == False + return input_value + + +def validate_and_convert_types(input_value, required_types_mixed, path_to_item, + from_server, _check_type, configuration=None): + """Raises a TypeError is there is a problem, otherwise returns value + + Args: + input_value (any): the data to validate/convert + required_types_mixed (list/dict/tuple): A list of + valid classes, or a list tuples of valid classes, or a dict where + the value is a tuple of value classes + path_to_item: (list) the path to the data being validated + this stores a list of keys or indices to get to the data being + validated + from_server (bool): True if data is from the server + False if data is from the client + _check_type: (boolean) if true, type will be checked and conversion + will be attempted. + configuration: (Configuration): the configuration class to use + when converting file_type items. + If passed, conversion will be attempted when possible + If not passed, no conversions will be attempted and + exceptions will be raised + + Returns: + the correctly typed value + + Raises: + ApiTypeError + """ + results = get_required_type_classes(required_types_mixed) + valid_classes, child_req_types_by_current_type = results + + input_class_simple = get_simple_class(input_value) + valid_type = input_class_simple in set(valid_classes) + if not valid_type: + if configuration: + # if input_value is not valid_type try to convert it + converted_instance = attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=True + ) + return converted_instance + else: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=False) + + # input_value's type is in valid_classes + if len(valid_classes) > 1 and configuration: + # there are valid classes which are not the current class + valid_classes_coercible = remove_uncoercible( + valid_classes, input_value, from_server, must_convert=False) + if valid_classes_coercible: + converted_instance = attempt_convert_item( + input_value, + valid_classes_coercible, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=False + ) + return converted_instance + + if child_req_types_by_current_type == {}: + # all types are of the required types and there are no more inner + # variables left to look at + return input_value + inner_required_types = child_req_types_by_current_type.get( + type(input_value) + ) + if inner_required_types is None: + # for this type, there are not more inner variables left to look at + return input_value + if isinstance(input_value, list): + if input_value == []: + # allow an empty list + return input_value + for index, inner_value in enumerate(input_value): + inner_path = list(path_to_item) + inner_path.append(index) + input_value[index] = validate_and_convert_types( + inner_value, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + elif isinstance(input_value, dict): + if input_value == {}: + # allow an empty dict + return input_value + for inner_key, inner_val in six.iteritems(input_value): + inner_path = list(path_to_item) + inner_path.append(inner_key) + if get_simple_class(inner_key) != str: + raise get_type_error(inner_key, inner_path, valid_classes, + key_type=True) + input_value[inner_key] = validate_and_convert_types( + inner_val, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + return input_value + + +def model_to_dict(model_instance, serialize=True): + """Returns the model properties as a dict + + Args: + model_instance (one of your model instances): the model instance that + will be converted to a dict. + + Keyword Args: + serialize (bool): if True, the keys in the dict will be values from + attribute_map + """ + result = {} + + for attr, value in six.iteritems(model_instance._data_store): + if serialize: + # we use get here because additional property key names do not + # exist in attribute_map + attr = model_instance.attribute_map.get(attr, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: model_to_dict(x, serialize=serialize) + if hasattr(x, '_data_store') else x, value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], + model_to_dict(item[1], serialize=serialize)) + if hasattr(item[1], '_data_store') else item, + value.items() + )) + elif hasattr(value, '_data_store'): + result[attr] = model_to_dict(value, serialize=serialize) + else: + result[attr] = value + + return result + + +def type_error_message(var_value=None, var_name=None, valid_classes=None, + key_type=None): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + """ + key_or_value = 'value' + if key_type: + key_or_value = 'key' + valid_classes_phrase = get_valid_classes_phrase(valid_classes) + msg = ( + "Invalid type for variable '{0}'. Required {1} type {2} and " + "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + ) + return msg + + +def get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed + Note: Adds the extra valid classes in python2 + """ + all_classes = list(input_classes) + if six.PY2 and str in input_classes: + all_classes.extend([str_py2, unicode_py2]) + if six.PY2 and int in input_classes: + all_classes.extend([int_py2, long_py2]) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return 'is {0}'.format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def get_py3_class_name(input_class): + if six.PY2: + if input_class == str: + return 'str' + elif input_class == int: + return 'int' + return input_class.__name__ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py new file mode 100644 index 000000000000..055355937d8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +# flake8: noqa +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +# import models into model package +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass +from petstore_api.models.animal import Animal +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly +from petstore_api.models.array_test import ArrayTest +from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat +from petstore_api.models.cat_all_of import CatAllOf +from petstore_api.models.category import Category +from petstore_api.models.class_model import ClassModel +from petstore_api.models.client import Client +from petstore_api.models.dog import Dog +from petstore_api.models.dog_all_of import DogAllOf +from petstore_api.models.enum_arrays import EnumArrays +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.enum_test import EnumTest +from petstore_api.models.file import File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.foo import Foo +from petstore_api.models.format_test import FormatTest +from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inline_object import InlineObject +from petstore_api.models.inline_object1 import InlineObject1 +from petstore_api.models.inline_object2 import InlineObject2 +from petstore_api.models.inline_object3 import InlineObject3 +from petstore_api.models.inline_object4 import InlineObject4 +from petstore_api.models.inline_object5 import InlineObject5 +from petstore_api.models.inline_response_default import InlineResponseDefault +from petstore_api.models.list import List +from petstore_api.models.map_test import MapTest +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.models.model200_response import Model200Response +from petstore_api.models.model_return import ModelReturn +from petstore_api.models.name import Name +from petstore_api.models.nullable_class import NullableClass +from petstore_api.models.number_only import NumberOnly +from petstore_api.models.order import Order +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue +from petstore_api.models.pet import Pet +from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap +from petstore_api.models.tag import Tag +from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py new file mode 100644 index 000000000000..980a953b8f83 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class AdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'map_property': 'map_property', # noqa: E501 + 'map_of_map_property': 'map_of_map_property' # noqa: E501 + } + + openapi_types = { + 'map_property': ({str: (str,)},), # noqa: E501 + 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """AdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_property ({str: (str,)}): [optional] # noqa: E501 + map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def map_property(self): + """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 + + Returns: + ({str: (str,)}): The map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('map_property') + + @map_property.setter + def map_property(self, value): + """Sets the map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('map_property', value) + + @property + def map_of_map_property(self): + """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + + Returns: + ({str: ({str: (str,)},)}): The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('map_of_map_property') + + @map_of_map_property.setter + def map_of_map_property(self, value): + """Sets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('map_of_map_property', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdditionalPropertiesClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py new file mode 100644 index 000000000000..d625389dd634 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.cat import Cat +from petstore_api.models.dog import Dog + + +class Animal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color' # noqa: E501 + } + + discriminator_value_class_map = { + 'Dog': Dog, + 'Cat': Cat + } + + openapi_types = { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = 'class_name' + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('class_name', class_name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def class_name(self): + """Gets the class_name of this Animal. # noqa: E501 + + Returns: + (str): The class_name of this Animal. # noqa: E501 + """ + return self.__get_item('class_name') + + @class_name.setter + def class_name(self, value): + """Sets the class_name of this Animal. # noqa: E501 + """ + return self.__set_item('class_name', value) + + @property + def color(self): + """Gets the color of this Animal. # noqa: E501 + + Returns: + (str): The color of this Animal. # noqa: E501 + """ + return self.__get_item('color') + + @color.setter + def color(self, value): + """Sets the color of this Animal. # noqa: E501 + """ + return self.__set_item('color', value) + + @classmethod + def get_real_child_model(cls, data): + """Returns the real base class specified by the discriminator + We assume that data has javascript keys + """ + discriminator_key = cls.attribute_map[cls.discriminator] + discriminator_value = data[discriminator_key] + return cls.discriminator_value_class_map.get(discriminator_value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Animal): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py new file mode 100644 index 000000000000..40713b75479a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ApiResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'code': 'code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'message': 'message' # noqa: E501 + } + + openapi_types = { + 'code': (int,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ApiResponse - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def code(self): + """Gets the code of this ApiResponse. # noqa: E501 + + Returns: + (int): The code of this ApiResponse. # noqa: E501 + """ + return self.__get_item('code') + + @code.setter + def code(self, value): + """Sets the code of this ApiResponse. # noqa: E501 + """ + return self.__set_item('code', value) + + @property + def type(self): + """Gets the type of this ApiResponse. # noqa: E501 + + Returns: + (str): The type of this ApiResponse. # noqa: E501 + """ + return self.__get_item('type') + + @type.setter + def type(self, value): + """Sets the type of this ApiResponse. # noqa: E501 + """ + return self.__set_item('type', value) + + @property + def message(self): + """Gets the message of this ApiResponse. # noqa: E501 + + Returns: + (str): The message of this ApiResponse. # noqa: E501 + """ + return self.__get_item('message') + + @message.setter + def message(self, value): + """Sets the message of this ApiResponse. # noqa: E501 + """ + return self.__set_item('message', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiResponse): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py new file mode 100644 index 000000000000..a2e3c7326a68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ArrayOfArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber' # noqa: E501 + } + + openapi_types = { + 'array_array_number': ([[float]],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_array_number ([[float]]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def array_array_number(self): + """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + + Returns: + ([[float]]): The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + """ + return self.__get_item('array_array_number') + + @array_array_number.setter + def array_array_number(self, value): + """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 + """ + return self.__set_item('array_array_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py new file mode 100644 index 000000000000..c35c8e59631c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'array_number': 'ArrayNumber' # noqa: E501 + } + + openapi_types = { + 'array_number': ([float],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_number ([float]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def array_number(self): + """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 + + Returns: + ([float]): The array_number of this ArrayOfNumberOnly. # noqa: E501 + """ + return self.__get_item('array_number') + + @array_number.setter + def array_number(self, value): + """Sets the array_number of this ArrayOfNumberOnly. # noqa: E501 + """ + return self.__set_item('array_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayOfNumberOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py new file mode 100644 index 000000000000..cc52f04d318f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.read_only_first import ReadOnlyFirst + + +class ArrayTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'array_of_string': 'array_of_string', # noqa: E501 + 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 + 'array_array_of_model': 'array_array_of_model' # noqa: E501 + } + + openapi_types = { + 'array_of_string': ([str],), # noqa: E501 + 'array_array_of_integer': ([[int]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ArrayTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_of_string ([str]): [optional] # noqa: E501 + array_array_of_integer ([[int]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def array_of_string(self): + """Gets the array_of_string of this ArrayTest. # noqa: E501 + + Returns: + ([str]): The array_of_string of this ArrayTest. # noqa: E501 + """ + return self.__get_item('array_of_string') + + @array_of_string.setter + def array_of_string(self, value): + """Sets the array_of_string of this ArrayTest. # noqa: E501 + """ + return self.__set_item('array_of_string', value) + + @property + def array_array_of_integer(self): + """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 + + Returns: + ([[int]]): The array_array_of_integer of this ArrayTest. # noqa: E501 + """ + return self.__get_item('array_array_of_integer') + + @array_array_of_integer.setter + def array_array_of_integer(self, value): + """Sets the array_array_of_integer of this ArrayTest. # noqa: E501 + """ + return self.__set_item('array_array_of_integer', value) + + @property + def array_array_of_model(self): + """Gets the array_array_of_model of this ArrayTest. # noqa: E501 + + Returns: + ([[ReadOnlyFirst]]): The array_array_of_model of this ArrayTest. # noqa: E501 + """ + return self.__get_item('array_array_of_model') + + @array_array_of_model.setter + def array_array_of_model(self, value): + """Sets the array_array_of_model of this ArrayTest. # noqa: E501 + """ + return self.__set_item('array_array_of_model', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ArrayTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py new file mode 100644 index 000000000000..9134f5e4251f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Capitalization(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'small_camel': 'smallCamel', # noqa: E501 + 'capital_camel': 'CapitalCamel', # noqa: E501 + 'small_snake': 'small_Snake', # noqa: E501 + 'capital_snake': 'Capital_Snake', # noqa: E501 + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 + 'att_name': 'ATT_NAME' # noqa: E501 + } + + openapi_types = { + 'small_camel': (str,), # noqa: E501 + 'capital_camel': (str,), # noqa: E501 + 'small_snake': (str,), # noqa: E501 + 'capital_snake': (str,), # noqa: E501 + 'sca_eth_flow_points': (str,), # noqa: E501 + 'att_name': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Capitalization - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def small_camel(self): + """Gets the small_camel of this Capitalization. # noqa: E501 + + Returns: + (str): The small_camel of this Capitalization. # noqa: E501 + """ + return self.__get_item('small_camel') + + @small_camel.setter + def small_camel(self, value): + """Sets the small_camel of this Capitalization. # noqa: E501 + """ + return self.__set_item('small_camel', value) + + @property + def capital_camel(self): + """Gets the capital_camel of this Capitalization. # noqa: E501 + + Returns: + (str): The capital_camel of this Capitalization. # noqa: E501 + """ + return self.__get_item('capital_camel') + + @capital_camel.setter + def capital_camel(self, value): + """Sets the capital_camel of this Capitalization. # noqa: E501 + """ + return self.__set_item('capital_camel', value) + + @property + def small_snake(self): + """Gets the small_snake of this Capitalization. # noqa: E501 + + Returns: + (str): The small_snake of this Capitalization. # noqa: E501 + """ + return self.__get_item('small_snake') + + @small_snake.setter + def small_snake(self, value): + """Sets the small_snake of this Capitalization. # noqa: E501 + """ + return self.__set_item('small_snake', value) + + @property + def capital_snake(self): + """Gets the capital_snake of this Capitalization. # noqa: E501 + + Returns: + (str): The capital_snake of this Capitalization. # noqa: E501 + """ + return self.__get_item('capital_snake') + + @capital_snake.setter + def capital_snake(self, value): + """Sets the capital_snake of this Capitalization. # noqa: E501 + """ + return self.__set_item('capital_snake', value) + + @property + def sca_eth_flow_points(self): + """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 + + Returns: + (str): The sca_eth_flow_points of this Capitalization. # noqa: E501 + """ + return self.__get_item('sca_eth_flow_points') + + @sca_eth_flow_points.setter + def sca_eth_flow_points(self, value): + """Sets the sca_eth_flow_points of this Capitalization. # noqa: E501 + """ + return self.__set_item('sca_eth_flow_points', value) + + @property + def att_name(self): + """Gets the att_name of this Capitalization. # noqa: E501 + Name of the pet # noqa: E501 + + Returns: + (str): The att_name of this Capitalization. # noqa: E501 + """ + return self.__get_item('att_name') + + @att_name.setter + def att_name(self, value): + """Sets the att_name of this Capitalization. # noqa: E501 + Name of the pet # noqa: E501 + """ + return self.__set_item('att_name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Capitalization): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py new file mode 100644 index 000000000000..40508dd3ce79 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Cat(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + 'declawed': 'declawed' # noqa: E501 + } + + openapi_types = { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'declawed': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Cat - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('class_name', class_name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def class_name(self): + """Gets the class_name of this Cat. # noqa: E501 + + Returns: + (str): The class_name of this Cat. # noqa: E501 + """ + return self.__get_item('class_name') + + @class_name.setter + def class_name(self, value): + """Sets the class_name of this Cat. # noqa: E501 + """ + return self.__set_item('class_name', value) + + @property + def color(self): + """Gets the color of this Cat. # noqa: E501 + + Returns: + (str): The color of this Cat. # noqa: E501 + """ + return self.__get_item('color') + + @color.setter + def color(self, value): + """Sets the color of this Cat. # noqa: E501 + """ + return self.__set_item('color', value) + + @property + def declawed(self): + """Gets the declawed of this Cat. # noqa: E501 + + Returns: + (bool): The declawed of this Cat. # noqa: E501 + """ + return self.__get_item('declawed') + + @declawed.setter + def declawed(self, value): + """Sets the declawed of this Cat. # noqa: E501 + """ + return self.__set_item('declawed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Cat): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py new file mode 100644 index 000000000000..cb1f0d815a0f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class CatAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'declawed': 'declawed' # noqa: E501 + } + + openapi_types = { + 'declawed': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """CatAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def declawed(self): + """Gets the declawed of this CatAllOf. # noqa: E501 + + Returns: + (bool): The declawed of this CatAllOf. # noqa: E501 + """ + return self.__get_item('declawed') + + @declawed.setter + def declawed(self, value): + """Sets the declawed of this CatAllOf. # noqa: E501 + """ + return self.__set_item('declawed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CatAllOf): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py new file mode 100644 index 000000000000..ca367ad9c3d2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Category(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, name='default-name', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('name', name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Category. # noqa: E501 + + Returns: + (int): The id of this Category. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Category. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def name(self): + """Gets the name of this Category. # noqa: E501 + + Returns: + (str): The name of this Category. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Category. # noqa: E501 + """ + return self.__set_item('name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Category): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py new file mode 100644 index 000000000000..b44cdb80aae0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ClassModel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + '_class': '_class' # noqa: E501 + } + + openapi_types = { + '_class': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ClassModel - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _class (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def _class(self): + """Gets the _class of this ClassModel. # noqa: E501 + + Returns: + (str): The _class of this ClassModel. # noqa: E501 + """ + return self.__get_item('_class') + + @_class.setter + def _class(self, value): + """Sets the _class of this ClassModel. # noqa: E501 + """ + return self.__set_item('_class', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ClassModel): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py new file mode 100644 index 000000000000..5e1699a2196b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Client(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'client': 'client' # noqa: E501 + } + + openapi_types = { + 'client': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Client - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + client (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def client(self): + """Gets the client of this Client. # noqa: E501 + + Returns: + (str): The client of this Client. # noqa: E501 + """ + return self.__get_item('client') + + @client.setter + def client(self, value): + """Sets the client of this Client. # noqa: E501 + """ + return self.__set_item('client', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Client): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py new file mode 100644 index 000000000000..bac013b867d9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Dog(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + 'breed': 'breed' # noqa: E501 + } + + openapi_types = { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + 'breed': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Dog - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('class_name', class_name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def class_name(self): + """Gets the class_name of this Dog. # noqa: E501 + + Returns: + (str): The class_name of this Dog. # noqa: E501 + """ + return self.__get_item('class_name') + + @class_name.setter + def class_name(self, value): + """Sets the class_name of this Dog. # noqa: E501 + """ + return self.__set_item('class_name', value) + + @property + def color(self): + """Gets the color of this Dog. # noqa: E501 + + Returns: + (str): The color of this Dog. # noqa: E501 + """ + return self.__get_item('color') + + @color.setter + def color(self, value): + """Sets the color of this Dog. # noqa: E501 + """ + return self.__set_item('color', value) + + @property + def breed(self): + """Gets the breed of this Dog. # noqa: E501 + + Returns: + (str): The breed of this Dog. # noqa: E501 + """ + return self.__get_item('breed') + + @breed.setter + def breed(self, value): + """Sets the breed of this Dog. # noqa: E501 + """ + return self.__set_item('breed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Dog): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py new file mode 100644 index 000000000000..7d9a33bbe365 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class DogAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'breed': 'breed' # noqa: E501 + } + + openapi_types = { + 'breed': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """DogAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def breed(self): + """Gets the breed of this DogAllOf. # noqa: E501 + + Returns: + (str): The breed of this DogAllOf. # noqa: E501 + """ + return self.__get_item('breed') + + @breed.setter + def breed(self, value): + """Sets the breed of this DogAllOf. # noqa: E501 + """ + return self.__set_item('breed', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DogAllOf): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py new file mode 100644 index 000000000000..477193e858f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -0,0 +1,260 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class EnumArrays(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('just_symbol',): { + '>=': ">=", + '$': "$", + }, + ('array_enum',): { + 'FISH': "fish", + 'CRAB': "crab", + }, + } + + attribute_map = { + 'just_symbol': 'just_symbol', # noqa: E501 + 'array_enum': 'array_enum' # noqa: E501 + } + + openapi_types = { + 'just_symbol': (str,), # noqa: E501 + 'array_enum': ([str],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """EnumArrays - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_symbol (str): [optional] # noqa: E501 + array_enum ([str]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def just_symbol(self): + """Gets the just_symbol of this EnumArrays. # noqa: E501 + + Returns: + (str): The just_symbol of this EnumArrays. # noqa: E501 + """ + return self.__get_item('just_symbol') + + @just_symbol.setter + def just_symbol(self, value): + """Sets the just_symbol of this EnumArrays. # noqa: E501 + """ + return self.__set_item('just_symbol', value) + + @property + def array_enum(self): + """Gets the array_enum of this EnumArrays. # noqa: E501 + + Returns: + ([str]): The array_enum of this EnumArrays. # noqa: E501 + """ + return self.__get_item('array_enum') + + @array_enum.setter + def array_enum(self, value): + """Sets the array_enum of this EnumArrays. # noqa: E501 + """ + return self.__set_item('array_enum', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumArrays): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py new file mode 100644 index 000000000000..0b3bca10a53e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class EnumClass(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + openapi_types = { + 'value': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """EnumClass - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to '-efg', must be one of ['-efg'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this EnumClass. # noqa: E501 + + Returns: + (str): The value of this EnumClass. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this EnumClass. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumClass): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py new file mode 100644 index 000000000000..b2db47a8573d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -0,0 +1,384 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue + + +class EnumTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_string_required',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_integer',): { + '1': 1, + '-1': -1, + }, + ('enum_number',): { + '1.1': 1.1, + '-1.2': -1.2, + }, + } + + attribute_map = { + 'enum_string': 'enum_string', # noqa: E501 + 'enum_string_required': 'enum_string_required', # noqa: E501 + 'enum_integer': 'enum_integer', # noqa: E501 + 'enum_number': 'enum_number', # noqa: E501 + 'outer_enum': 'outerEnum', # noqa: E501 + 'outer_enum_integer': 'outerEnumInteger', # noqa: E501 + 'outer_enum_default_value': 'outerEnumDefaultValue', # noqa: E501 + 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue' # noqa: E501 + } + + openapi_types = { + 'enum_string': (str,), # noqa: E501 + 'enum_string_required': (str,), # noqa: E501 + 'enum_integer': (int,), # noqa: E501 + 'enum_number': (float,), # noqa: E501 + 'outer_enum': (OuterEnum,), # noqa: E501 + 'outer_enum_integer': (OuterEnumInteger,), # noqa: E501 + 'outer_enum_default_value': (OuterEnumDefaultValue,), # noqa: E501 + 'outer_enum_integer_default_value': (OuterEnumIntegerDefaultValue,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, enum_string_required, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + outer_enum (OuterEnum): [optional] # noqa: E501 + outer_enum_integer (OuterEnumInteger): [optional] # noqa: E501 + outer_enum_default_value (OuterEnumDefaultValue): [optional] # noqa: E501 + outer_enum_integer_default_value (OuterEnumIntegerDefaultValue): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('enum_string_required', enum_string_required) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def enum_string(self): + """Gets the enum_string of this EnumTest. # noqa: E501 + + Returns: + (str): The enum_string of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_string') + + @enum_string.setter + def enum_string(self, value): + """Sets the enum_string of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_string', value) + + @property + def enum_string_required(self): + """Gets the enum_string_required of this EnumTest. # noqa: E501 + + Returns: + (str): The enum_string_required of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_string_required') + + @enum_string_required.setter + def enum_string_required(self, value): + """Sets the enum_string_required of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_string_required', value) + + @property + def enum_integer(self): + """Gets the enum_integer of this EnumTest. # noqa: E501 + + Returns: + (int): The enum_integer of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_integer') + + @enum_integer.setter + def enum_integer(self, value): + """Sets the enum_integer of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_integer', value) + + @property + def enum_number(self): + """Gets the enum_number of this EnumTest. # noqa: E501 + + Returns: + (float): The enum_number of this EnumTest. # noqa: E501 + """ + return self.__get_item('enum_number') + + @enum_number.setter + def enum_number(self, value): + """Sets the enum_number of this EnumTest. # noqa: E501 + """ + return self.__set_item('enum_number', value) + + @property + def outer_enum(self): + """Gets the outer_enum of this EnumTest. # noqa: E501 + + Returns: + (OuterEnum): The outer_enum of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum') + + @outer_enum.setter + def outer_enum(self, value): + """Sets the outer_enum of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum', value) + + @property + def outer_enum_integer(self): + """Gets the outer_enum_integer of this EnumTest. # noqa: E501 + + Returns: + (OuterEnumInteger): The outer_enum_integer of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum_integer') + + @outer_enum_integer.setter + def outer_enum_integer(self, value): + """Sets the outer_enum_integer of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum_integer', value) + + @property + def outer_enum_default_value(self): + """Gets the outer_enum_default_value of this EnumTest. # noqa: E501 + + Returns: + (OuterEnumDefaultValue): The outer_enum_default_value of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum_default_value') + + @outer_enum_default_value.setter + def outer_enum_default_value(self, value): + """Sets the outer_enum_default_value of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum_default_value', value) + + @property + def outer_enum_integer_default_value(self): + """Gets the outer_enum_integer_default_value of this EnumTest. # noqa: E501 + + Returns: + (OuterEnumIntegerDefaultValue): The outer_enum_integer_default_value of this EnumTest. # noqa: E501 + """ + return self.__get_item('outer_enum_integer_default_value') + + @outer_enum_integer_default_value.setter + def outer_enum_integer_default_value(self, value): + """Sets the outer_enum_integer_default_value of this EnumTest. # noqa: E501 + """ + return self.__set_item('outer_enum_integer_default_value', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnumTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py new file mode 100644 index 000000000000..7da4e025a205 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py @@ -0,0 +1,236 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class File(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'source_uri': 'sourceURI' # noqa: E501 + } + + openapi_types = { + 'source_uri': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """File - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def source_uri(self): + """Gets the source_uri of this File. # noqa: E501 + Test capitalization # noqa: E501 + + Returns: + (str): The source_uri of this File. # noqa: E501 + """ + return self.__get_item('source_uri') + + @source_uri.setter + def source_uri(self, value): + """Sets the source_uri of this File. # noqa: E501 + Test capitalization # noqa: E501 + """ + return self.__set_item('source_uri', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, File): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py new file mode 100644 index 000000000000..5e0ca0498d9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.file import File + + +class FileSchemaTestClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'file': 'file', # noqa: E501 + 'files': 'files' # noqa: E501 + } + + openapi_types = { + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """FileSchemaTestClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def file(self): + """Gets the file of this FileSchemaTestClass. # noqa: E501 + + Returns: + (File): The file of this FileSchemaTestClass. # noqa: E501 + """ + return self.__get_item('file') + + @file.setter + def file(self, value): + """Sets the file of this FileSchemaTestClass. # noqa: E501 + """ + return self.__set_item('file', value) + + @property + def files(self): + """Gets the files of this FileSchemaTestClass. # noqa: E501 + + Returns: + ([File]): The files of this FileSchemaTestClass. # noqa: E501 + """ + return self.__get_item('files') + + @files.setter + def files(self, value): + """Sets the files of this FileSchemaTestClass. # noqa: E501 + """ + return self.__set_item('files', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FileSchemaTestClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py new file mode 100644 index 000000000000..60997bcf82d3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Foo(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'bar': 'bar' # noqa: E501 + } + + openapi_types = { + 'bar': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Foo - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] if omitted the server will use the default value of 'bar' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def bar(self): + """Gets the bar of this Foo. # noqa: E501 + + Returns: + (str): The bar of this Foo. # noqa: E501 + """ + return self.__get_item('bar') + + @bar.setter + def bar(self, value): + """Sets the bar of this Foo. # noqa: E501 + """ + return self.__set_item('bar', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Foo): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py new file mode 100644 index 000000000000..85304db27f5a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -0,0 +1,536 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class FormatTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'number': 'number', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date': 'date', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'uuid': 'uuid', # noqa: E501 + 'password': 'password', # noqa: E501 + 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 + 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter' # noqa: E501 + } + + openapi_types = { + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'number': (float,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'uuid': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'pattern_with_digits': (str,), # noqa: E501 + 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 + } + + validations = { + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('float',): { + 'inclusive_maximum': 987.6, + 'inclusive_minimum': 54.3, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + ('pattern_with_digits',): { + 'regex': { + 'pattern': r'^\d{10}$', # noqa: E501 + }, + }, + ('pattern_with_digits_and_delimiter',): { + 'regex': { + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, number, byte, date, password, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file_type): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 + pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('number', number) + self.__set_item('byte', byte) + self.__set_item('date', date) + self.__set_item('password', password) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def integer(self): + """Gets the integer of this FormatTest. # noqa: E501 + + Returns: + (int): The integer of this FormatTest. # noqa: E501 + """ + return self.__get_item('integer') + + @integer.setter + def integer(self, value): + """Sets the integer of this FormatTest. # noqa: E501 + """ + return self.__set_item('integer', value) + + @property + def int32(self): + """Gets the int32 of this FormatTest. # noqa: E501 + + Returns: + (int): The int32 of this FormatTest. # noqa: E501 + """ + return self.__get_item('int32') + + @int32.setter + def int32(self, value): + """Sets the int32 of this FormatTest. # noqa: E501 + """ + return self.__set_item('int32', value) + + @property + def int64(self): + """Gets the int64 of this FormatTest. # noqa: E501 + + Returns: + (int): The int64 of this FormatTest. # noqa: E501 + """ + return self.__get_item('int64') + + @int64.setter + def int64(self, value): + """Sets the int64 of this FormatTest. # noqa: E501 + """ + return self.__set_item('int64', value) + + @property + def number(self): + """Gets the number of this FormatTest. # noqa: E501 + + Returns: + (float): The number of this FormatTest. # noqa: E501 + """ + return self.__get_item('number') + + @number.setter + def number(self, value): + """Sets the number of this FormatTest. # noqa: E501 + """ + return self.__set_item('number', value) + + @property + def float(self): + """Gets the float of this FormatTest. # noqa: E501 + + Returns: + (float): The float of this FormatTest. # noqa: E501 + """ + return self.__get_item('float') + + @float.setter + def float(self, value): + """Sets the float of this FormatTest. # noqa: E501 + """ + return self.__set_item('float', value) + + @property + def double(self): + """Gets the double of this FormatTest. # noqa: E501 + + Returns: + (float): The double of this FormatTest. # noqa: E501 + """ + return self.__get_item('double') + + @double.setter + def double(self, value): + """Sets the double of this FormatTest. # noqa: E501 + """ + return self.__set_item('double', value) + + @property + def string(self): + """Gets the string of this FormatTest. # noqa: E501 + + Returns: + (str): The string of this FormatTest. # noqa: E501 + """ + return self.__get_item('string') + + @string.setter + def string(self, value): + """Sets the string of this FormatTest. # noqa: E501 + """ + return self.__set_item('string', value) + + @property + def byte(self): + """Gets the byte of this FormatTest. # noqa: E501 + + Returns: + (str): The byte of this FormatTest. # noqa: E501 + """ + return self.__get_item('byte') + + @byte.setter + def byte(self, value): + """Sets the byte of this FormatTest. # noqa: E501 + """ + return self.__set_item('byte', value) + + @property + def binary(self): + """Gets the binary of this FormatTest. # noqa: E501 + + Returns: + (file_type): The binary of this FormatTest. # noqa: E501 + """ + return self.__get_item('binary') + + @binary.setter + def binary(self, value): + """Sets the binary of this FormatTest. # noqa: E501 + """ + return self.__set_item('binary', value) + + @property + def date(self): + """Gets the date of this FormatTest. # noqa: E501 + + Returns: + (date): The date of this FormatTest. # noqa: E501 + """ + return self.__get_item('date') + + @date.setter + def date(self, value): + """Sets the date of this FormatTest. # noqa: E501 + """ + return self.__set_item('date', value) + + @property + def date_time(self): + """Gets the date_time of this FormatTest. # noqa: E501 + + Returns: + (datetime): The date_time of this FormatTest. # noqa: E501 + """ + return self.__get_item('date_time') + + @date_time.setter + def date_time(self, value): + """Sets the date_time of this FormatTest. # noqa: E501 + """ + return self.__set_item('date_time', value) + + @property + def uuid(self): + """Gets the uuid of this FormatTest. # noqa: E501 + + Returns: + (str): The uuid of this FormatTest. # noqa: E501 + """ + return self.__get_item('uuid') + + @uuid.setter + def uuid(self, value): + """Sets the uuid of this FormatTest. # noqa: E501 + """ + return self.__set_item('uuid', value) + + @property + def password(self): + """Gets the password of this FormatTest. # noqa: E501 + + Returns: + (str): The password of this FormatTest. # noqa: E501 + """ + return self.__get_item('password') + + @password.setter + def password(self, value): + """Sets the password of this FormatTest. # noqa: E501 + """ + return self.__set_item('password', value) + + @property + def pattern_with_digits(self): + """Gets the pattern_with_digits of this FormatTest. # noqa: E501 + A string that is a 10 digit number. Can have leading zeros. # noqa: E501 + + Returns: + (str): The pattern_with_digits of this FormatTest. # noqa: E501 + """ + return self.__get_item('pattern_with_digits') + + @pattern_with_digits.setter + def pattern_with_digits(self, value): + """Sets the pattern_with_digits of this FormatTest. # noqa: E501 + A string that is a 10 digit number. Can have leading zeros. # noqa: E501 + """ + return self.__set_item('pattern_with_digits', value) + + @property + def pattern_with_digits_and_delimiter(self): + """Gets the pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 + A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 + + Returns: + (str): The pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 + """ + return self.__get_item('pattern_with_digits_and_delimiter') + + @pattern_with_digits_and_delimiter.setter + def pattern_with_digits_and_delimiter(self, value): + """Sets the pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 + A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 + """ + return self.__set_item('pattern_with_digits_and_delimiter', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FormatTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py new file mode 100644 index 000000000000..ecf201d21e81 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class HasOnlyReadOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'foo': 'foo' # noqa: E501 + } + + openapi_types = { + 'bar': (str,), # noqa: E501 + 'foo': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """HasOnlyReadOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def bar(self): + """Gets the bar of this HasOnlyReadOnly. # noqa: E501 + + Returns: + (str): The bar of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__get_item('bar') + + @bar.setter + def bar(self, value): + """Sets the bar of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__set_item('bar', value) + + @property + def foo(self): + """Gets the foo of this HasOnlyReadOnly. # noqa: E501 + + Returns: + (str): The foo of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__get_item('foo') + + @foo.setter + def foo(self, value): + """Sets the foo of this HasOnlyReadOnly. # noqa: E501 + """ + return self.__set_item('foo', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HasOnlyReadOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py new file mode 100644 index 000000000000..9da7bc6f3939 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class HealthCheckResult(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'nullable_message': 'NullableMessage' # noqa: E501 + } + + openapi_types = { + 'nullable_message': (str, none_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """HealthCheckResult - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + nullable_message (str, none_type): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def nullable_message(self): + """Gets the nullable_message of this HealthCheckResult. # noqa: E501 + + Returns: + (str, none_type): The nullable_message of this HealthCheckResult. # noqa: E501 + """ + return self.__get_item('nullable_message') + + @nullable_message.setter + def nullable_message(self, value): + """Sets the nullable_message of this HealthCheckResult. # noqa: E501 + """ + return self.__set_item('nullable_message', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, HealthCheckResult): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py new file mode 100644 index 000000000000..f91a27142a47 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'name': 'name', # noqa: E501 + 'status': 'status' # noqa: E501 + } + + openapi_types = { + 'name': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (str): Updated name of the pet. [optional] # noqa: E501 + status (str): Updated status of the pet. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def name(self): + """Gets the name of this InlineObject. # noqa: E501 + Updated name of the pet # noqa: E501 + + Returns: + (str): The name of this InlineObject. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this InlineObject. # noqa: E501 + Updated name of the pet # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def status(self): + """Gets the status of this InlineObject. # noqa: E501 + Updated status of the pet # noqa: E501 + + Returns: + (str): The status of this InlineObject. # noqa: E501 + """ + return self.__get_item('status') + + @status.setter + def status(self, value): + """Sets the status of this InlineObject. # noqa: E501 + Updated status of the pet # noqa: E501 + """ + return self.__set_item('status', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py new file mode 100644 index 000000000000..85fe82650f34 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py @@ -0,0 +1,256 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject1(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'additional_metadata': 'additionalMetadata', # noqa: E501 + 'file': 'file' # noqa: E501 + } + + openapi_types = { + 'additional_metadata': (str,), # noqa: E501 + 'file': (file_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject1 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + file (file_type): file to upload. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def additional_metadata(self): + """Gets the additional_metadata of this InlineObject1. # noqa: E501 + Additional data to pass to server # noqa: E501 + + Returns: + (str): The additional_metadata of this InlineObject1. # noqa: E501 + """ + return self.__get_item('additional_metadata') + + @additional_metadata.setter + def additional_metadata(self, value): + """Sets the additional_metadata of this InlineObject1. # noqa: E501 + Additional data to pass to server # noqa: E501 + """ + return self.__set_item('additional_metadata', value) + + @property + def file(self): + """Gets the file of this InlineObject1. # noqa: E501 + file to upload # noqa: E501 + + Returns: + (file_type): The file of this InlineObject1. # noqa: E501 + """ + return self.__get_item('file') + + @file.setter + def file(self, value): + """Sets the file of this InlineObject1. # noqa: E501 + file to upload # noqa: E501 + """ + return self.__set_item('file', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject1): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py new file mode 100644 index 000000000000..30513dbafe98 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py @@ -0,0 +1,265 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject2(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_form_string_array',): { + '>': ">", + '$': "$", + }, + ('enum_form_string',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + attribute_map = { + 'enum_form_string_array': 'enum_form_string_array', # noqa: E501 + 'enum_form_string': 'enum_form_string' # noqa: E501 + } + + openapi_types = { + 'enum_form_string_array': ([str],), # noqa: E501 + 'enum_form_string': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject2 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] # noqa: E501 + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def enum_form_string_array(self): + """Gets the enum_form_string_array of this InlineObject2. # noqa: E501 + Form parameter enum test (string array) # noqa: E501 + + Returns: + ([str]): The enum_form_string_array of this InlineObject2. # noqa: E501 + """ + return self.__get_item('enum_form_string_array') + + @enum_form_string_array.setter + def enum_form_string_array(self, value): + """Sets the enum_form_string_array of this InlineObject2. # noqa: E501 + Form parameter enum test (string array) # noqa: E501 + """ + return self.__set_item('enum_form_string_array', value) + + @property + def enum_form_string(self): + """Gets the enum_form_string of this InlineObject2. # noqa: E501 + Form parameter enum test (string) # noqa: E501 + + Returns: + (str): The enum_form_string of this InlineObject2. # noqa: E501 + """ + return self.__get_item('enum_form_string') + + @enum_form_string.setter + def enum_form_string(self, value): + """Sets the enum_form_string of this InlineObject2. # noqa: E501 + Form parameter enum test (string) # noqa: E501 + """ + return self.__set_item('enum_form_string', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject2): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py new file mode 100644 index 000000000000..fa2710feeb59 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py @@ -0,0 +1,535 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject3(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'number': 'number', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'pattern_without_delimiter': 'pattern_without_delimiter', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date': 'date', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'password': 'password', # noqa: E501 + 'callback': 'callback' # noqa: E501 + } + + openapi_types = { + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'number': (float,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'pattern_without_delimiter': (str,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'callback': (str,), # noqa: E501 + } + + validations = { + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('float',): { + 'inclusive_maximum': 987.6, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('pattern_without_delimiter',): { + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, number, double, pattern_without_delimiter, byte, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject3 - a model defined in OpenAPI + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): None. [optional] # noqa: E501 + int32 (int): None. [optional] # noqa: E501 + int64 (int): None. [optional] # noqa: E501 + float (float): None. [optional] # noqa: E501 + string (str): None. [optional] # noqa: E501 + binary (file_type): None. [optional] # noqa: E501 + date (date): None. [optional] # noqa: E501 + date_time (datetime): None. [optional] # noqa: E501 + password (str): None. [optional] # noqa: E501 + callback (str): None. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('number', number) + self.__set_item('double', double) + self.__set_item('pattern_without_delimiter', pattern_without_delimiter) + self.__set_item('byte', byte) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def integer(self): + """Gets the integer of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (int): The integer of this InlineObject3. # noqa: E501 + """ + return self.__get_item('integer') + + @integer.setter + def integer(self, value): + """Sets the integer of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('integer', value) + + @property + def int32(self): + """Gets the int32 of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (int): The int32 of this InlineObject3. # noqa: E501 + """ + return self.__get_item('int32') + + @int32.setter + def int32(self, value): + """Sets the int32 of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('int32', value) + + @property + def int64(self): + """Gets the int64 of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (int): The int64 of this InlineObject3. # noqa: E501 + """ + return self.__get_item('int64') + + @int64.setter + def int64(self, value): + """Sets the int64 of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('int64', value) + + @property + def number(self): + """Gets the number of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (float): The number of this InlineObject3. # noqa: E501 + """ + return self.__get_item('number') + + @number.setter + def number(self, value): + """Sets the number of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('number', value) + + @property + def float(self): + """Gets the float of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (float): The float of this InlineObject3. # noqa: E501 + """ + return self.__get_item('float') + + @float.setter + def float(self, value): + """Sets the float of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('float', value) + + @property + def double(self): + """Gets the double of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (float): The double of this InlineObject3. # noqa: E501 + """ + return self.__get_item('double') + + @double.setter + def double(self, value): + """Sets the double of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('double', value) + + @property + def string(self): + """Gets the string of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The string of this InlineObject3. # noqa: E501 + """ + return self.__get_item('string') + + @string.setter + def string(self, value): + """Sets the string of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('string', value) + + @property + def pattern_without_delimiter(self): + """Gets the pattern_without_delimiter of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The pattern_without_delimiter of this InlineObject3. # noqa: E501 + """ + return self.__get_item('pattern_without_delimiter') + + @pattern_without_delimiter.setter + def pattern_without_delimiter(self, value): + """Sets the pattern_without_delimiter of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('pattern_without_delimiter', value) + + @property + def byte(self): + """Gets the byte of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The byte of this InlineObject3. # noqa: E501 + """ + return self.__get_item('byte') + + @byte.setter + def byte(self, value): + """Sets the byte of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('byte', value) + + @property + def binary(self): + """Gets the binary of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (file_type): The binary of this InlineObject3. # noqa: E501 + """ + return self.__get_item('binary') + + @binary.setter + def binary(self, value): + """Sets the binary of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('binary', value) + + @property + def date(self): + """Gets the date of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (date): The date of this InlineObject3. # noqa: E501 + """ + return self.__get_item('date') + + @date.setter + def date(self, value): + """Sets the date of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('date', value) + + @property + def date_time(self): + """Gets the date_time of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (datetime): The date_time of this InlineObject3. # noqa: E501 + """ + return self.__get_item('date_time') + + @date_time.setter + def date_time(self, value): + """Sets the date_time of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('date_time', value) + + @property + def password(self): + """Gets the password of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The password of this InlineObject3. # noqa: E501 + """ + return self.__get_item('password') + + @password.setter + def password(self, value): + """Sets the password of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('password', value) + + @property + def callback(self): + """Gets the callback of this InlineObject3. # noqa: E501 + None # noqa: E501 + + Returns: + (str): The callback of this InlineObject3. # noqa: E501 + """ + return self.__get_item('callback') + + @callback.setter + def callback(self, value): + """Sets the callback of this InlineObject3. # noqa: E501 + None # noqa: E501 + """ + return self.__set_item('callback', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject3): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py new file mode 100644 index 000000000000..f77211884ada --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject4(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'param': 'param', # noqa: E501 + 'param2': 'param2' # noqa: E501 + } + + openapi_types = { + 'param': (str,), # noqa: E501 + 'param2': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject4 - a model defined in OpenAPI + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('param', param) + self.__set_item('param2', param2) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def param(self): + """Gets the param of this InlineObject4. # noqa: E501 + field1 # noqa: E501 + + Returns: + (str): The param of this InlineObject4. # noqa: E501 + """ + return self.__get_item('param') + + @param.setter + def param(self, value): + """Sets the param of this InlineObject4. # noqa: E501 + field1 # noqa: E501 + """ + return self.__set_item('param', value) + + @property + def param2(self): + """Gets the param2 of this InlineObject4. # noqa: E501 + field2 # noqa: E501 + + Returns: + (str): The param2 of this InlineObject4. # noqa: E501 + """ + return self.__get_item('param2') + + @param2.setter + def param2(self, value): + """Sets the param2 of this InlineObject4. # noqa: E501 + field2 # noqa: E501 + """ + return self.__set_item('param2', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject4): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py new file mode 100644 index 000000000000..b143ac20ee95 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py @@ -0,0 +1,258 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class InlineObject5(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'additional_metadata': 'additionalMetadata', # noqa: E501 + 'required_file': 'requiredFile' # noqa: E501 + } + + openapi_types = { + 'additional_metadata': (str,), # noqa: E501 + 'required_file': (file_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, required_file, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineObject5 - a model defined in OpenAPI + + Args: + required_file (file_type): file to upload + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('required_file', required_file) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def additional_metadata(self): + """Gets the additional_metadata of this InlineObject5. # noqa: E501 + Additional data to pass to server # noqa: E501 + + Returns: + (str): The additional_metadata of this InlineObject5. # noqa: E501 + """ + return self.__get_item('additional_metadata') + + @additional_metadata.setter + def additional_metadata(self, value): + """Sets the additional_metadata of this InlineObject5. # noqa: E501 + Additional data to pass to server # noqa: E501 + """ + return self.__set_item('additional_metadata', value) + + @property + def required_file(self): + """Gets the required_file of this InlineObject5. # noqa: E501 + file to upload # noqa: E501 + + Returns: + (file_type): The required_file of this InlineObject5. # noqa: E501 + """ + return self.__get_item('required_file') + + @required_file.setter + def required_file(self, value): + """Sets the required_file of this InlineObject5. # noqa: E501 + file to upload # noqa: E501 + """ + return self.__set_item('required_file', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineObject5): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py new file mode 100644 index 000000000000..52d6240613a1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.foo import Foo + + +class InlineResponseDefault(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'string': 'string' # noqa: E501 + } + + openapi_types = { + 'string': (Foo,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """InlineResponseDefault - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + string (Foo): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def string(self): + """Gets the string of this InlineResponseDefault. # noqa: E501 + + Returns: + (Foo): The string of this InlineResponseDefault. # noqa: E501 + """ + return self.__get_item('string') + + @string.setter + def string(self, value): + """Sets the string of this InlineResponseDefault. # noqa: E501 + """ + return self.__set_item('string', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponseDefault): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py new file mode 100644 index 000000000000..79ff6c81bede --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class List(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + '_123_list': '123-list' # noqa: E501 + } + + openapi_types = { + '_123_list': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """List - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _123_list (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def _123_list(self): + """Gets the _123_list of this List. # noqa: E501 + + Returns: + (str): The _123_list of this List. # noqa: E501 + """ + return self.__get_item('_123_list') + + @_123_list.setter + def _123_list(self, value): + """Sets the _123_list of this List. # noqa: E501 + """ + return self.__set_item('_123_list', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, List): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py new file mode 100644 index 000000000000..84b07abdcc8d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -0,0 +1,293 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.string_boolean_map import StringBooleanMap + + +class MapTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('map_of_enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + }, + } + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', # noqa: E501 + 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 + 'direct_map': 'direct_map', # noqa: E501 + 'indirect_map': 'indirect_map' # noqa: E501 + } + + openapi_types = { + 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 + 'map_of_enum_string': ({str: (str,)},), # noqa: E501 + 'direct_map': ({str: (bool,)},), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """MapTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 + direct_map ({str: (bool,)}): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def map_map_of_string(self): + """Gets the map_map_of_string of this MapTest. # noqa: E501 + + Returns: + ({str: ({str: (str,)},)}): The map_map_of_string of this MapTest. # noqa: E501 + """ + return self.__get_item('map_map_of_string') + + @map_map_of_string.setter + def map_map_of_string(self, value): + """Sets the map_map_of_string of this MapTest. # noqa: E501 + """ + return self.__set_item('map_map_of_string', value) + + @property + def map_of_enum_string(self): + """Gets the map_of_enum_string of this MapTest. # noqa: E501 + + Returns: + ({str: (str,)}): The map_of_enum_string of this MapTest. # noqa: E501 + """ + return self.__get_item('map_of_enum_string') + + @map_of_enum_string.setter + def map_of_enum_string(self, value): + """Sets the map_of_enum_string of this MapTest. # noqa: E501 + """ + return self.__set_item('map_of_enum_string', value) + + @property + def direct_map(self): + """Gets the direct_map of this MapTest. # noqa: E501 + + Returns: + ({str: (bool,)}): The direct_map of this MapTest. # noqa: E501 + """ + return self.__get_item('direct_map') + + @direct_map.setter + def direct_map(self, value): + """Sets the direct_map of this MapTest. # noqa: E501 + """ + return self.__set_item('direct_map', value) + + @property + def indirect_map(self): + """Gets the indirect_map of this MapTest. # noqa: E501 + + Returns: + (StringBooleanMap): The indirect_map of this MapTest. # noqa: E501 + """ + return self.__get_item('indirect_map') + + @indirect_map.setter + def indirect_map(self, value): + """Sets the indirect_map of this MapTest. # noqa: E501 + """ + return self.__set_item('indirect_map', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MapTest): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..a8f9efb42974 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.animal import Animal + + +class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'uuid': 'uuid', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'map': 'map' # noqa: E501 + } + + openapi_types = { + 'uuid': (str,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def uuid(self): + """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + Returns: + (str): The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('uuid') + + @uuid.setter + def uuid(self, value): + """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('uuid', value) + + @property + def date_time(self): + """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + Returns: + (datetime): The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('date_time') + + @date_time.setter + def date_time(self, value): + """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('date_time', value) + + @property + def map(self): + """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + + Returns: + ({str: (Animal,)}): The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__get_item('map') + + @map.setter + def map(self, value): + """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 + """ + return self.__set_item('map', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py new file mode 100644 index 000000000000..4bb72561e846 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Model200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'name': 'name', # noqa: E501 + '_class': 'class' # noqa: E501 + } + + openapi_types = { + 'name': (int,), # noqa: E501 + '_class': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Model200Response - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def name(self): + """Gets the name of this Model200Response. # noqa: E501 + + Returns: + (int): The name of this Model200Response. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Model200Response. # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def _class(self): + """Gets the _class of this Model200Response. # noqa: E501 + + Returns: + (str): The _class of this Model200Response. # noqa: E501 + """ + return self.__get_item('_class') + + @_class.setter + def _class(self, value): + """Sets the _class of this Model200Response. # noqa: E501 + """ + return self.__set_item('_class', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Model200Response): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py new file mode 100644 index 000000000000..1ca322750bf4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ModelReturn(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + '_return': 'return' # noqa: E501 + } + + openapi_types = { + '_return': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ModelReturn - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _return (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def _return(self): + """Gets the _return of this ModelReturn. # noqa: E501 + + Returns: + (int): The _return of this ModelReturn. # noqa: E501 + """ + return self.__get_item('_return') + + @_return.setter + def _return(self, value): + """Sets the _return of this ModelReturn. # noqa: E501 + """ + return self.__set_item('_return', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ModelReturn): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py new file mode 100644 index 000000000000..b4c205ae08c9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py @@ -0,0 +1,290 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Name(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'name': 'name', # noqa: E501 + 'snake_case': 'snake_case', # noqa: E501 + '_property': 'property', # noqa: E501 + '_123_number': '123Number' # noqa: E501 + } + + openapi_types = { + 'name': (int,), # noqa: E501 + 'snake_case': (int,), # noqa: E501 + '_property': (str,), # noqa: E501 + '_123_number': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('name', name) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def name(self): + """Gets the name of this Name. # noqa: E501 + + Returns: + (int): The name of this Name. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Name. # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def snake_case(self): + """Gets the snake_case of this Name. # noqa: E501 + + Returns: + (int): The snake_case of this Name. # noqa: E501 + """ + return self.__get_item('snake_case') + + @snake_case.setter + def snake_case(self, value): + """Sets the snake_case of this Name. # noqa: E501 + """ + return self.__set_item('snake_case', value) + + @property + def _property(self): + """Gets the _property of this Name. # noqa: E501 + + Returns: + (str): The _property of this Name. # noqa: E501 + """ + return self.__get_item('_property') + + @_property.setter + def _property(self, value): + """Sets the _property of this Name. # noqa: E501 + """ + return self.__set_item('_property', value) + + @property + def _123_number(self): + """Gets the _123_number of this Name. # noqa: E501 + + Returns: + (int): The _123_number of this Name. # noqa: E501 + """ + return self.__get_item('_123_number') + + @_123_number.setter + def _123_number(self, value): + """Sets the _123_number of this Name. # noqa: E501 + """ + return self.__set_item('_123_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Name): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py new file mode 100644 index 000000000000..333baa12d124 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py @@ -0,0 +1,432 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class NullableClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'integer_prop': 'integer_prop', # noqa: E501 + 'number_prop': 'number_prop', # noqa: E501 + 'boolean_prop': 'boolean_prop', # noqa: E501 + 'string_prop': 'string_prop', # noqa: E501 + 'date_prop': 'date_prop', # noqa: E501 + 'datetime_prop': 'datetime_prop', # noqa: E501 + 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 + 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 + 'array_items_nullable': 'array_items_nullable', # noqa: E501 + 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 + 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 + 'object_items_nullable': 'object_items_nullable' # noqa: E501 + } + + openapi_types = { + 'integer_prop': (int, none_type,), # noqa: E501 + 'number_prop': (float, none_type,), # noqa: E501 + 'boolean_prop': (bool, none_type,), # noqa: E501 + 'string_prop': (str, none_type,), # noqa: E501 + 'date_prop': (date, none_type,), # noqa: E501 + 'datetime_prop': (datetime, none_type,), # noqa: E501 + 'array_nullable_prop': ([bool, date, datetime, dict, float, int, list, str], none_type,), # noqa: E501 + 'array_and_items_nullable_prop': ([bool, date, datetime, dict, float, int, list, str, none_type], none_type,), # noqa: E501 + 'array_items_nullable': ([bool, date, datetime, dict, float, int, list, str, none_type],), # noqa: E501 + 'object_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type,), # noqa: E501 + 'object_and_items_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'object_items_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + validations = { + } + + additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """NullableClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer_prop (int, none_type): [optional] # noqa: E501 + number_prop (float, none_type): [optional] # noqa: E501 + boolean_prop (bool, none_type): [optional] # noqa: E501 + string_prop (str, none_type): [optional] # noqa: E501 + date_prop (date, none_type): [optional] # noqa: E501 + datetime_prop (datetime, none_type): [optional] # noqa: E501 + array_nullable_prop ([bool, date, datetime, dict, float, int, list, str], none_type): [optional] # noqa: E501 + array_and_items_nullable_prop ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): [optional] # noqa: E501 + array_items_nullable ([bool, date, datetime, dict, float, int, list, str, none_type]): [optional] # noqa: E501 + object_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): [optional] # noqa: E501 + object_and_items_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + object_items_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def integer_prop(self): + """Gets the integer_prop of this NullableClass. # noqa: E501 + + Returns: + (int, none_type): The integer_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('integer_prop') + + @integer_prop.setter + def integer_prop(self, value): + """Sets the integer_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('integer_prop', value) + + @property + def number_prop(self): + """Gets the number_prop of this NullableClass. # noqa: E501 + + Returns: + (float, none_type): The number_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('number_prop') + + @number_prop.setter + def number_prop(self, value): + """Sets the number_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('number_prop', value) + + @property + def boolean_prop(self): + """Gets the boolean_prop of this NullableClass. # noqa: E501 + + Returns: + (bool, none_type): The boolean_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('boolean_prop') + + @boolean_prop.setter + def boolean_prop(self, value): + """Sets the boolean_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('boolean_prop', value) + + @property + def string_prop(self): + """Gets the string_prop of this NullableClass. # noqa: E501 + + Returns: + (str, none_type): The string_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('string_prop') + + @string_prop.setter + def string_prop(self, value): + """Sets the string_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('string_prop', value) + + @property + def date_prop(self): + """Gets the date_prop of this NullableClass. # noqa: E501 + + Returns: + (date, none_type): The date_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('date_prop') + + @date_prop.setter + def date_prop(self, value): + """Sets the date_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('date_prop', value) + + @property + def datetime_prop(self): + """Gets the datetime_prop of this NullableClass. # noqa: E501 + + Returns: + (datetime, none_type): The datetime_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('datetime_prop') + + @datetime_prop.setter + def datetime_prop(self, value): + """Sets the datetime_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('datetime_prop', value) + + @property + def array_nullable_prop(self): + """Gets the array_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ([bool, date, datetime, dict, float, int, list, str], none_type): The array_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('array_nullable_prop') + + @array_nullable_prop.setter + def array_nullable_prop(self, value): + """Sets the array_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('array_nullable_prop', value) + + @property + def array_and_items_nullable_prop(self): + """Gets the array_and_items_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): The array_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('array_and_items_nullable_prop') + + @array_and_items_nullable_prop.setter + def array_and_items_nullable_prop(self, value): + """Sets the array_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('array_and_items_nullable_prop', value) + + @property + def array_items_nullable(self): + """Gets the array_items_nullable of this NullableClass. # noqa: E501 + + Returns: + ([bool, date, datetime, dict, float, int, list, str, none_type]): The array_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__get_item('array_items_nullable') + + @array_items_nullable.setter + def array_items_nullable(self, value): + """Sets the array_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__set_item('array_items_nullable', value) + + @property + def object_nullable_prop(self): + """Gets the object_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): The object_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('object_nullable_prop') + + @object_nullable_prop.setter + def object_nullable_prop(self, value): + """Sets the object_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('object_nullable_prop', value) + + @property + def object_and_items_nullable_prop(self): + """Gets the object_and_items_nullable_prop of this NullableClass. # noqa: E501 + + Returns: + ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): The object_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__get_item('object_and_items_nullable_prop') + + @object_and_items_nullable_prop.setter + def object_and_items_nullable_prop(self, value): + """Sets the object_and_items_nullable_prop of this NullableClass. # noqa: E501 + """ + return self.__set_item('object_and_items_nullable_prop', value) + + @property + def object_items_nullable(self): + """Gets the object_items_nullable of this NullableClass. # noqa: E501 + + Returns: + ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The object_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__get_item('object_items_nullable') + + @object_items_nullable.setter + def object_items_nullable(self, value): + """Sets the object_items_nullable of this NullableClass. # noqa: E501 + """ + return self.__set_item('object_items_nullable', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NullableClass): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py new file mode 100644 index 000000000000..0761b3d3e323 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class NumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'just_number': 'JustNumber' # noqa: E501 + } + + openapi_types = { + 'just_number': (float,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """NumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_number (float): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def just_number(self): + """Gets the just_number of this NumberOnly. # noqa: E501 + + Returns: + (float): The just_number of this NumberOnly. # noqa: E501 + """ + return self.__get_item('just_number') + + @just_number.setter + def just_number(self, value): + """Sets the just_number of this NumberOnly. # noqa: E501 + """ + return self.__set_item('just_number', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NumberOnly): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py new file mode 100644 index 000000000000..64c84902aba5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py @@ -0,0 +1,331 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Order(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'pet_id': 'petId', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'ship_date': 'shipDate', # noqa: E501 + 'status': 'status', # noqa: E501 + 'complete': 'complete' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'pet_id': (int,), # noqa: E501 + 'quantity': (int,), # noqa: E501 + 'ship_date': (datetime,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'complete': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Order - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Order. # noqa: E501 + + Returns: + (int): The id of this Order. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Order. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def pet_id(self): + """Gets the pet_id of this Order. # noqa: E501 + + Returns: + (int): The pet_id of this Order. # noqa: E501 + """ + return self.__get_item('pet_id') + + @pet_id.setter + def pet_id(self, value): + """Sets the pet_id of this Order. # noqa: E501 + """ + return self.__set_item('pet_id', value) + + @property + def quantity(self): + """Gets the quantity of this Order. # noqa: E501 + + Returns: + (int): The quantity of this Order. # noqa: E501 + """ + return self.__get_item('quantity') + + @quantity.setter + def quantity(self, value): + """Sets the quantity of this Order. # noqa: E501 + """ + return self.__set_item('quantity', value) + + @property + def ship_date(self): + """Gets the ship_date of this Order. # noqa: E501 + + Returns: + (datetime): The ship_date of this Order. # noqa: E501 + """ + return self.__get_item('ship_date') + + @ship_date.setter + def ship_date(self, value): + """Sets the ship_date of this Order. # noqa: E501 + """ + return self.__set_item('ship_date', value) + + @property + def status(self): + """Gets the status of this Order. # noqa: E501 + Order Status # noqa: E501 + + Returns: + (str): The status of this Order. # noqa: E501 + """ + return self.__get_item('status') + + @status.setter + def status(self, value): + """Sets the status of this Order. # noqa: E501 + Order Status # noqa: E501 + """ + return self.__set_item('status', value) + + @property + def complete(self): + """Gets the complete of this Order. # noqa: E501 + + Returns: + (bool): The complete of this Order. # noqa: E501 + """ + return self.__get_item('complete') + + @complete.setter + def complete(self, value): + """Sets the complete of this Order. # noqa: E501 + """ + return self.__set_item('complete', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Order): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py new file mode 100644 index 000000000000..ac5364799dbc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterComposite(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'my_number': 'my_number', # noqa: E501 + 'my_string': 'my_string', # noqa: E501 + 'my_boolean': 'my_boolean' # noqa: E501 + } + + openapi_types = { + 'my_number': (float,), # noqa: E501 + 'my_string': (str,), # noqa: E501 + 'my_boolean': (bool,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterComposite - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + my_number (float): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def my_number(self): + """Gets the my_number of this OuterComposite. # noqa: E501 + + Returns: + (float): The my_number of this OuterComposite. # noqa: E501 + """ + return self.__get_item('my_number') + + @my_number.setter + def my_number(self, value): + """Sets the my_number of this OuterComposite. # noqa: E501 + """ + return self.__set_item('my_number', value) + + @property + def my_string(self): + """Gets the my_string of this OuterComposite. # noqa: E501 + + Returns: + (str): The my_string of this OuterComposite. # noqa: E501 + """ + return self.__get_item('my_string') + + @my_string.setter + def my_string(self, value): + """Sets the my_string of this OuterComposite. # noqa: E501 + """ + return self.__set_item('my_string', value) + + @property + def my_boolean(self): + """Gets the my_boolean of this OuterComposite. # noqa: E501 + + Returns: + (bool): The my_boolean of this OuterComposite. # noqa: E501 + """ + return self.__get_item('my_boolean') + + @my_boolean.setter + def my_boolean(self, value): + """Sets the my_boolean of this OuterComposite. # noqa: E501 + """ + return self.__set_item('my_boolean', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterComposite): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py new file mode 100644 index 000000000000..06f998d1e541 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -0,0 +1,227 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + openapi_types = { + 'value': (str, none_type,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnum - a model defined in OpenAPI + + Args: + value (str, none_type): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnum. # noqa: E501 + + Returns: + (str, none_type): The value of this OuterEnum. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnum. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnum): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py new file mode 100644 index 000000000000..c867f7048565 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnumDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + openapi_types = { + 'value': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value='placed', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnumDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to 'placed', must be one of ['placed'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnumDefaultValue. # noqa: E501 + + Returns: + (str): The value of this OuterEnumDefaultValue. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnumDefaultValue. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnumDefaultValue): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py new file mode 100644 index 000000000000..b4faf008cc33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnumInteger(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + openapi_types = { + 'value': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnumInteger - a model defined in OpenAPI + + Args: + value (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnumInteger. # noqa: E501 + + Returns: + (int): The value of this OuterEnumInteger. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnumInteger. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnumInteger): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py new file mode 100644 index 000000000000..3dafc4738ec8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py @@ -0,0 +1,226 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class OuterEnumIntegerDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + openapi_types = { + 'value': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """OuterEnumIntegerDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (int): defaults to 0, must be one of [0] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('value', value) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def value(self): + """Gets the value of this OuterEnumIntegerDefaultValue. # noqa: E501 + + Returns: + (int): The value of this OuterEnumIntegerDefaultValue. # noqa: E501 + """ + return self.__get_item('value') + + @value.setter + def value(self, value): + """Sets the value of this OuterEnumIntegerDefaultValue. # noqa: E501 + """ + return self.__set_item('value', value) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OuterEnumIntegerDefaultValue): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py new file mode 100644 index 000000000000..3abfdfba760c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py @@ -0,0 +1,336 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) +from petstore_api.models.category import Category +from petstore_api.models.tag import Tag + + +class Pet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'AVAILABLE': "available", + 'PENDING': "pending", + 'SOLD': "sold", + }, + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'category': 'category', # noqa: E501 + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'status': 'status' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'photo_urls': ([str],), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.__set_item('name', name) + self.__set_item('photo_urls', photo_urls) + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Pet. # noqa: E501 + + Returns: + (int): The id of this Pet. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Pet. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def category(self): + """Gets the category of this Pet. # noqa: E501 + + Returns: + (Category): The category of this Pet. # noqa: E501 + """ + return self.__get_item('category') + + @category.setter + def category(self, value): + """Sets the category of this Pet. # noqa: E501 + """ + return self.__set_item('category', value) + + @property + def name(self): + """Gets the name of this Pet. # noqa: E501 + + Returns: + (str): The name of this Pet. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Pet. # noqa: E501 + """ + return self.__set_item('name', value) + + @property + def photo_urls(self): + """Gets the photo_urls of this Pet. # noqa: E501 + + Returns: + ([str]): The photo_urls of this Pet. # noqa: E501 + """ + return self.__get_item('photo_urls') + + @photo_urls.setter + def photo_urls(self, value): + """Sets the photo_urls of this Pet. # noqa: E501 + """ + return self.__set_item('photo_urls', value) + + @property + def tags(self): + """Gets the tags of this Pet. # noqa: E501 + + Returns: + ([Tag]): The tags of this Pet. # noqa: E501 + """ + return self.__get_item('tags') + + @tags.setter + def tags(self, value): + """Sets the tags of this Pet. # noqa: E501 + """ + return self.__set_item('tags', value) + + @property + def status(self): + """Gets the status of this Pet. # noqa: E501 + pet status in the store # noqa: E501 + + Returns: + (str): The status of this Pet. # noqa: E501 + """ + return self.__get_item('status') + + @status.setter + def status(self, value): + """Sets the status of this Pet. # noqa: E501 + pet status in the store # noqa: E501 + """ + return self.__set_item('status', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Pet): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py new file mode 100644 index 000000000000..848fbccfa913 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class ReadOnlyFirst(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'baz': 'baz' # noqa: E501 + } + + openapi_types = { + 'bar': (str,), # noqa: E501 + 'baz': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """ReadOnlyFirst - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def bar(self): + """Gets the bar of this ReadOnlyFirst. # noqa: E501 + + Returns: + (str): The bar of this ReadOnlyFirst. # noqa: E501 + """ + return self.__get_item('bar') + + @bar.setter + def bar(self, value): + """Sets the bar of this ReadOnlyFirst. # noqa: E501 + """ + return self.__set_item('bar', value) + + @property + def baz(self): + """Gets the baz of this ReadOnlyFirst. # noqa: E501 + + Returns: + (str): The baz of this ReadOnlyFirst. # noqa: E501 + """ + return self.__get_item('baz') + + @baz.setter + def baz(self, value): + """Sets the baz of this ReadOnlyFirst. # noqa: E501 + """ + return self.__set_item('baz', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ReadOnlyFirst): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py new file mode 100644 index 000000000000..83810bdb8941 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -0,0 +1,234 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class SpecialModelName(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'special_property_name': '$special[property.name]' # noqa: E501 + } + + openapi_types = { + 'special_property_name': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """SpecialModelName - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + special_property_name (int): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def special_property_name(self): + """Gets the special_property_name of this SpecialModelName. # noqa: E501 + + Returns: + (int): The special_property_name of this SpecialModelName. # noqa: E501 + """ + return self.__get_item('special_property_name') + + @special_property_name.setter + def special_property_name(self, value): + """Sets the special_property_name of this SpecialModelName. # noqa: E501 + """ + return self.__set_item('special_property_name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SpecialModelName): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py new file mode 100644 index 000000000000..1d10f9a8d7ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class StringBooleanMap(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + } + + openapi_types = { + } + + validations = { + } + + additional_properties_type = (bool,) # noqa: E501 + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """StringBooleanMap - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StringBooleanMap): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py new file mode 100644 index 000000000000..4e1fd5ef077e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class Tag(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """Tag - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this Tag. # noqa: E501 + + Returns: + (int): The id of this Tag. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this Tag. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def name(self): + """Gets the name of this Tag. # noqa: E501 + + Returns: + (str): The name of this Tag. # noqa: E501 + """ + return self.__get_item('name') + + @name.setter + def name(self, value): + """Sets the name of this Tag. # noqa: E501 + """ + return self.__set_item('name', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Tag): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py new file mode 100644 index 000000000000..6d4d4539a849 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py @@ -0,0 +1,362 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import pprint # noqa: F401 +import re # noqa: F401 + +import six # noqa: F401 + +from petstore_api.exceptions import ( # noqa: F401 + ApiKeyError, + ApiTypeError, + ApiValueError, +) +from petstore_api.model_utils import ( # noqa: F401 + ModelNormal, + ModelSimple, + check_allowed_values, + check_validations, + date, + datetime, + file_type, + get_simple_class, + int, + model_to_dict, + none_type, + str, + type_error_message, + validate_and_convert_types +) + + +class User(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + openapi_types (dict): The key is attribute name + and the value is attribute type. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + attribute_map = { + 'id': 'id', # noqa: E501 + 'username': 'username', # noqa: E501 + 'first_name': 'firstName', # noqa: E501 + 'last_name': 'lastName', # noqa: E501 + 'email': 'email', # noqa: E501 + 'password': 'password', # noqa: E501 + 'phone': 'phone', # noqa: E501 + 'user_status': 'userStatus' # noqa: E501 + } + + openapi_types = { + 'id': (int,), # noqa: E501 + 'username': (str,), # noqa: E501 + 'first_name': (str,), # noqa: E501 + 'last_name': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'phone': (str,), # noqa: E501 + 'user_status': (int,), # noqa: E501 + } + + validations = { + } + + additional_properties_type = None + + discriminator = None + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """User - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + """ + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + self.__set_item(var_name, var_value) + + def __set_item(self, name, value): + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self._data_store[name] = value + + def __get_item(self, name): + if name in self._data_store: + return self._data_store[name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__set_item(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__get_item(name) + + @property + def id(self): + """Gets the id of this User. # noqa: E501 + + Returns: + (int): The id of this User. # noqa: E501 + """ + return self.__get_item('id') + + @id.setter + def id(self, value): + """Sets the id of this User. # noqa: E501 + """ + return self.__set_item('id', value) + + @property + def username(self): + """Gets the username of this User. # noqa: E501 + + Returns: + (str): The username of this User. # noqa: E501 + """ + return self.__get_item('username') + + @username.setter + def username(self, value): + """Sets the username of this User. # noqa: E501 + """ + return self.__set_item('username', value) + + @property + def first_name(self): + """Gets the first_name of this User. # noqa: E501 + + Returns: + (str): The first_name of this User. # noqa: E501 + """ + return self.__get_item('first_name') + + @first_name.setter + def first_name(self, value): + """Sets the first_name of this User. # noqa: E501 + """ + return self.__set_item('first_name', value) + + @property + def last_name(self): + """Gets the last_name of this User. # noqa: E501 + + Returns: + (str): The last_name of this User. # noqa: E501 + """ + return self.__get_item('last_name') + + @last_name.setter + def last_name(self, value): + """Sets the last_name of this User. # noqa: E501 + """ + return self.__set_item('last_name', value) + + @property + def email(self): + """Gets the email of this User. # noqa: E501 + + Returns: + (str): The email of this User. # noqa: E501 + """ + return self.__get_item('email') + + @email.setter + def email(self, value): + """Sets the email of this User. # noqa: E501 + """ + return self.__set_item('email', value) + + @property + def password(self): + """Gets the password of this User. # noqa: E501 + + Returns: + (str): The password of this User. # noqa: E501 + """ + return self.__get_item('password') + + @password.setter + def password(self, value): + """Sets the password of this User. # noqa: E501 + """ + return self.__set_item('password', value) + + @property + def phone(self): + """Gets the phone of this User. # noqa: E501 + + Returns: + (str): The phone of this User. # noqa: E501 + """ + return self.__get_item('phone') + + @phone.setter + def phone(self, value): + """Sets the phone of this User. # noqa: E501 + """ + return self.__set_item('phone', value) + + @property + def user_status(self): + """Gets the user_status of this User. # noqa: E501 + User Status # noqa: E501 + + Returns: + (int): The user_status of this User. # noqa: E501 + """ + return self.__get_item('user_status') + + @user_status.setter + def user_status(self, value): + """Sets the user_status of this User. # noqa: E501 + User Status # noqa: E501 + """ + return self.__set_item('user_status', value) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, User): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py new file mode 100644 index 000000000000..7ed815b8a187 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode +import urllib3 + +from petstore_api.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt new file mode 100644 index 000000000000..eb358efd5bd3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/requirements.txt @@ -0,0 +1,6 @@ +certifi >= 14.05.14 +future; python_version<="2.7" +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py new file mode 100644 index 000000000000..b896f2ff0b68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES.append("pem>=19.3.0") +REQUIRES.append("pycryptodome>=3.9.0") +EXTRAS = {':python_version <= "2.7"': ['future']} + +setup( + name=NAME, + version=VERSION, + description="OpenAPI Petstore", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + install_requires=REQUIRES, + extras_require=EXTRAS, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache-2.0", + long_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: \" \\ # noqa: E501 + """ +) diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt new file mode 100644 index 000000000000..5816b8749532 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -0,0 +1,7 @@ +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 +mock; python_version<="2.7" + diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/petstore/python-experimental/test/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py new file mode 100644 index 000000000000..af455282e558 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py new file mode 100644 index 000000000000..36e8afaaa7dc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.animal import Animal # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.animal.Animal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py new file mode 100644 index 000000000000..d95798cfc5a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_call_123_test_special_tags(self): + """Test case for call_123_test_special_tags + + To test special tags # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py new file mode 100644 index 000000000000..5032e2a92160 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.api_response import ApiResponse # noqa: E501 +from petstore_api.rest import ApiException + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py new file mode 100644 index 000000000000..c938bf374df7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py new file mode 100644 index 000000000000..8148b493c1bc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py new file mode 100644 index 000000000000..a463e28234e8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.array_test import ArrayTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py new file mode 100644 index 000000000000..d8bba72f3d1b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.capitalization import Capitalization # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py new file mode 100644 index 000000000000..06008bf4aaad --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.cat import Cat # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.cat.Cat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py new file mode 100644 index 000000000000..496e348e1d54 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCatAllOf(unittest.TestCase): + """CatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCatAllOf(self): + """Test CatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py new file mode 100644 index 000000000000..257ef19234ac --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.category import Category # noqa: E501 +from petstore_api.rest import ApiException + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.category.Category() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py new file mode 100644 index 000000000000..6fa92ec9070f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.class_model import ClassModel # noqa: E501 +from petstore_api.rest import ApiException + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.class_model.ClassModel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py new file mode 100644 index 000000000000..d7425ab273e7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.client import Client # noqa: E501 +from petstore_api.rest import ApiException + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.client.Client() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py new file mode 100644 index 000000000000..50e7c57bd0bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.default_api import DefaultApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501 + + def tearDown(self): + pass + + def test_foo_get(self): + """Test case for foo_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py new file mode 100644 index 000000000000..56e58d709f0d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.dog import Dog # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """Test Dog""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.dog.Dog() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py new file mode 100644 index 000000000000..8f83f6c7192b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDogAllOf(unittest.TestCase): + """DogAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDogAllOf(self): + """Test DogAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py new file mode 100644 index 000000000000..02f5019ec643 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 +from petstore_api.rest import ApiException + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumArrays(self): + """Test EnumArrays""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py new file mode 100644 index 000000000000..87a14751a178 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.enum_class import EnumClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py new file mode 100644 index 000000000000..be0bd7859b39 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.enum_test import EnumTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py new file mode 100644 index 000000000000..581d1499eedf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_fake_health_get(self): + """Test case for fake_health_get + + Health check endpoint # noqa: E501 + """ + pass + + def test_fake_outer_boolean_serialize(self): + """Test case for fake_outer_boolean_serialize + + """ + pass + + def test_fake_outer_composite_serialize(self): + """Test case for fake_outer_composite_serialize + + """ + pass + + def test_fake_outer_number_serialize(self): + """Test case for fake_outer_number_serialize + + """ + pass + + def test_fake_outer_string_serialize(self): + """Test case for fake_outer_string_serialize + + """ + pass + + def test_test_body_with_file_schema(self): + """Test case for test_body_with_file_schema + + """ + pass + + def test_test_body_with_query_params(self): + """Test case for test_body_with_query_params + + """ + pass + + def test_test_client_model(self): + """Test case for test_client_model + + To test \"client\" model # noqa: E501 + """ + pass + + def test_test_endpoint_parameters(self): + """Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + """ + pass + + def test_test_enum_parameters(self): + """Test case for test_enum_parameters + + To test enum parameters # noqa: E501 + """ + pass + + def test_test_group_parameters(self): + """Test case for test_group_parameters + + Fake endpoint to test group parameters (optional) # noqa: E501 + """ + pass + + def test_test_inline_additional_properties(self): + """Test case for test_inline_additional_properties + + test inline additionalProperties # noqa: E501 + """ + pass + + def test_test_json_form_data(self): + """Test case for test_json_form_data + + test json serialization of form data # noqa: E501 + """ + pass + + def test_test_query_parameter_collection_format(self): + """Test case for test_query_parameter_collection_format + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py new file mode 100644 index 000000000000..f54e0d06644f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py new file mode 100644 index 000000000000..6c30ca900683 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.file import File # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFile(unittest.TestCase): + """File unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFile(self): + """Test File""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.file.File() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py new file mode 100644 index 000000000000..30ba7dffbfca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFileSchemaTestClass(self): + """Test FileSchemaTestClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py new file mode 100644 index 000000000000..1c4d0794d85e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.foo import Foo # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFoo(unittest.TestCase): + """Foo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFoo(self): + """Test Foo""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.foo.Foo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py new file mode 100644 index 000000000000..b7ddece031f0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.format_test import FormatTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFormatTest(self): + """Test FormatTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.format_test.FormatTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py new file mode 100644 index 000000000000..308ad18085d6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py new file mode 100644 index 000000000000..7fcee8775e07 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501 +from petstore_api.rest import ApiException + + +class TestHealthCheckResult(unittest.TestCase): + """HealthCheckResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHealthCheckResult(self): + """Test HealthCheckResult""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py new file mode 100644 index 000000000000..5247a9683ba8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object import InlineObject # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject(unittest.TestCase): + """InlineObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject(self): + """Test InlineObject""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object.InlineObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py new file mode 100644 index 000000000000..79045ee8624b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object1 import InlineObject1 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject1(unittest.TestCase): + """InlineObject1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject1(self): + """Test InlineObject1""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object1.InlineObject1() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py new file mode 100644 index 000000000000..cf25ce661569 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object2 import InlineObject2 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject2(unittest.TestCase): + """InlineObject2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject2(self): + """Test InlineObject2""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object2.InlineObject2() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py new file mode 100644 index 000000000000..b48bc0c7d1f4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object3 import InlineObject3 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject3(unittest.TestCase): + """InlineObject3 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject3(self): + """Test InlineObject3""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object3.InlineObject3() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py new file mode 100644 index 000000000000..4db27423b858 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object4 import InlineObject4 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject4(unittest.TestCase): + """InlineObject4 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject4(self): + """Test InlineObject4""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object4.InlineObject4() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py new file mode 100644 index 000000000000..229bada2af53 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_object5 import InlineObject5 # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineObject5(unittest.TestCase): + """InlineObject5 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject5(self): + """Test InlineObject5""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_object5.InlineObject5() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py new file mode 100644 index 000000000000..2f77f14b9f84 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.inline_response_default import InlineResponseDefault # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInlineResponseDefault(unittest.TestCase): + """InlineResponseDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponseDefault(self): + """Test InlineResponseDefault""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.inline_response_default.InlineResponseDefault() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py new file mode 100644 index 000000000000..dc1ac9d82e50 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_list.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.list import List # noqa: E501 +from petstore_api.rest import ApiException + + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """Test List""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.list.List() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py new file mode 100644 index 000000000000..e34d75cab4e3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.map_test import MapTest # noqa: E501 +from petstore_api.rest import ApiException + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMapTest(self): + """Test MapTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.map_test.MapTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..294ef15f1572 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py new file mode 100644 index 000000000000..5c98c9b3ee14 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.model200_response import Model200Response # noqa: E501 +from petstore_api.rest import ApiException + + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py new file mode 100644 index 000000000000..7dcfacc1fbb8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.model_return import ModelReturn # noqa: E501 +from petstore_api.rest import ApiException + + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py new file mode 100644 index 000000000000..f421e0a7ebe6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.name import Name # noqa: E501 +from petstore_api.rest import ApiException + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.name.Name() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py new file mode 100644 index 000000000000..eaa1aace505a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.nullable_class import NullableClass # noqa: E501 +from petstore_api.rest import ApiException + + +class TestNullableClass(unittest.TestCase): + """NullableClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNullableClass(self): + """Test NullableClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py new file mode 100644 index 000000000000..43d5df2ac75f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.number_only import NumberOnly # noqa: E501 +from petstore_api.rest import ApiException + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py new file mode 100644 index 000000000000..f9bcbc3cab85 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.order import Order # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """Test Order""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.order.Order() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py new file mode 100644 index 000000000000..af3b218592c5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_composite import OuterComposite # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterComposite(unittest.TestCase): + """OuterComposite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """Test OuterComposite""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py new file mode 100644 index 000000000000..bf6441407505 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum import OuterEnum # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnum(unittest.TestCase): + """OuterEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """Test OuterEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py new file mode 100644 index 000000000000..cb3c112b0ec3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnumDefaultValue(unittest.TestCase): + """OuterEnumDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumDefaultValue(self): + """Test OuterEnumDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum_default_value.OuterEnumDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py new file mode 100644 index 000000000000..34b0d1cc0250 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnumInteger(unittest.TestCase): + """OuterEnumInteger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumInteger(self): + """Test OuterEnumInteger""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum_integer.OuterEnumInteger() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py new file mode 100644 index 000000000000..53158d0ce2e0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501 +from petstore_api.rest import ApiException + + +class TestOuterEnumIntegerDefaultValue(unittest.TestCase): + """OuterEnumIntegerDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumIntegerDefaultValue(self): + """Test OuterEnumIntegerDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.outer_enum_integer_default_value.OuterEnumIntegerDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py new file mode 100644 index 000000000000..b05f6aad6a8a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.pet import Pet # noqa: E501 +from petstore_api.rest import ApiException + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPet(self): + """Test Pet""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.pet.Pet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py new file mode 100644 index 000000000000..77665df879f1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_pet(self): + """Test case for add_pet + + Add a new pet to the store # noqa: E501 + """ + pass + + def test_delete_pet(self): + """Test case for delete_pet + + Deletes a pet # noqa: E501 + """ + pass + + def test_find_pets_by_status(self): + """Test case for find_pets_by_status + + Finds Pets by status # noqa: E501 + """ + pass + + def test_find_pets_by_tags(self): + """Test case for find_pets_by_tags + + Finds Pets by tags # noqa: E501 + """ + pass + + def test_get_pet_by_id(self): + """Test case for get_pet_by_id + + Find pet by ID # noqa: E501 + """ + pass + + def test_update_pet(self): + """Test case for update_pet + + Update an existing pet # noqa: E501 + """ + pass + + def test_update_pet_with_form(self): + """Test case for update_pet_with_form + + Updates a pet in the store with form data # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads an image # noqa: E501 + """ + pass + + def test_upload_file_with_required_file(self): + """Test case for upload_file_with_required_file + + uploads an image (required) # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py new file mode 100644 index 000000000000..9223d493aff0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 +from petstore_api.rest import ApiException + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py new file mode 100644 index 000000000000..5c9f30f71fec --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 +from petstore_api.rest import ApiException + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py new file mode 100644 index 000000000000..81848d24a67e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_order(self): + """Test case for delete_order + + Delete purchase order by ID # noqa: E501 + """ + pass + + def test_get_inventory(self): + """Test case for get_inventory + + Returns pet inventories by status # noqa: E501 + """ + pass + + def test_get_order_by_id(self): + """Test case for get_order_by_id + + Find purchase order by ID # noqa: E501 + """ + pass + + def test_place_order(self): + """Test case for place_order + + Place an order for a pet # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py new file mode 100644 index 000000000000..31c1ebeec5db --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.string_boolean_map import StringBooleanMap # noqa: E501 +from petstore_api.rest import ApiException + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringBooleanMap(self): + """Test StringBooleanMap""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.string_boolean_map.StringBooleanMap() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py new file mode 100644 index 000000000000..b0c8ef0c6816 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.tag import Tag # noqa: E501 +from petstore_api.rest import ApiException + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.tag.Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py new file mode 100644 index 000000000000..cb026e3edb5b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.user import User # noqa: E501 +from petstore_api.rest import ApiException + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.user.User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py new file mode 100644 index 000000000000..6df730fba2b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.user_api.UserApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_user(self): + """Test case for create_user + + Create user # noqa: E501 + """ + pass + + def test_create_users_with_array_input(self): + """Test case for create_users_with_array_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_create_users_with_list_input(self): + """Test case for create_users_with_list_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_delete_user(self): + """Test case for delete_user + + Delete user # noqa: E501 + """ + pass + + def test_get_user_by_name(self): + """Test case for get_user_by_name + + Get user by user name # noqa: E501 + """ + pass + + def test_login_user(self): + """Test case for login_user + + Logs user into the system # noqa: E501 + """ + pass + + def test_logout_user(self): + """Test case for logout_user + + Logs out current logged in user session # noqa: E501 + """ + pass + + def test_update_user(self): + """Test case for update_user + + Updated user # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests/__init__.py b/samples/openapi3/client/petstore/python-experimental/tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py b/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py new file mode 100644 index 000000000000..51fb281e7bdf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py @@ -0,0 +1,225 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIetstore-python +$ nosetests -v +""" + +import os +import time +import unittest +from dateutil.parser import parse +from Crypto.PublicKey import RSA, ECC + +import petstore_api +import petstore_api.configuration + +HOST = 'http://petstore.swagger.io/v2' + + +class ApiClientTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + + def test_http_signature(self): + """ Test HTTP signature authentication. + """ + header_params = { + 'test1': 'value1', + 'test2': 'value2', + 'Content-Type': 'application/json' + } + query_params = {'test2': 'value2'} + auth_settings = ['http_signature_test'] + + # Generate RSA key for test purpose + rsakey = RSA.generate(2048) + # Generate ECDSA key for test purpose + ecdsakey = ECC.generate(curve='p521') + #ecdsakey = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p) + + for privkey in [ rsakey, ecdsakey ]: + config = petstore_api.Configuration() + config.host = 'http://localhost/' + config.key_id = 'test-key' + config.private_key_path = None + config.signing_scheme = 'hs2019' + config.signed_headers = ['test1', 'Content-Type'] + config.private_key = privkey + if isinstance(privkey, RSA.RsaKey): + signing_algorithms = ['PKCS1-v1_5', 'PSS'] + elif isinstance(privkey, ECC.EccKey): + signing_algorithms = ['fips-186-3', 'deterministic-rfc6979'] + + for signing_algorithm in signing_algorithms: + config.signing_algorithm = signing_algorithm + + client = petstore_api.ApiClient(config) + + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings, + resource_path='/pet', method='POST', body='{ }') + self.assertTrue('Digest' in header_params) + self.assertTrue('Authorization' in header_params) + self.assertTrue('Date' in header_params) + self.assertTrue('Host' in header_params) + #for hdr_key, hdr_value in header_params.items(): + # print("HEADER: {0}={1}".format(hdr_key, hdr_value)) + + def test_configuration(self): + config = petstore_api.Configuration() + config.host = 'http://localhost/' + + # Test api_key authentication + config.api_key['api_key'] = '123456' + config.api_key_prefix['api_key'] = 'PREFIX' + config.username = 'test_username' + config.password = 'test_password' + + header_params = {'test1': 'value1'} + query_params = {'test2': 'value2'} + auth_settings = ['api_key', 'unknown'] + + client = petstore_api.ApiClient(config) + + # test prefix + self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) + + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings) + + # test api key auth + self.assertEqual(header_params['test1'], 'value1') + self.assertEqual(header_params['api_key'], 'PREFIX 123456') + self.assertEqual(query_params['test2'], 'value2') + + # test basic auth + self.assertEqual('test_username', client.configuration.username) + self.assertEqual('test_password', client.configuration.password) + + def test_select_header_accept(self): + accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/json', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/xml', 'application/json'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['text/plain', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'text/plain, application/xml') + + accepts = [] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, None) + + def test_select_header_content_type(self): + content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/json', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/xml', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['text/plain', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'text/plain') + + content_types = [] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + def test_sanitize_for_serialization(self): + # None + data = None + result = self.api_client.sanitize_for_serialization(None) + self.assertEqual(result, data) + + # str + data = "test string" + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # int + data = 1 + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # bool + data = True + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # date + data = parse("1997-07-16").date() # date + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16") + + # datetime + data = parse("1997-07-16T19:20:30.45+01:00") # datetime + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") + + # list + data = [1] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # dict + data = {"test key": "test value"} + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # model + pet_dict = {"id": 1, "name": "monkey", + "category": {"id": 1, "name": "test category"}, + "tags": [{"id": 1, "name": "test tag1"}, + {"id": 2, "name": "test tag2"}], + "status": "available", + "photoUrls": ["http://foo.bar.com/3", + "http://foo.bar.com/4"]} + pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) + pet.id = pet_dict["id"] + cate = petstore_api.Category() + cate.id = pet_dict["category"]["id"] + cate.name = pet_dict["category"]["name"] + pet.category = cate + tag1 = petstore_api.Tag() + tag1.id = pet_dict["tags"][0]["id"] + tag1.name = pet_dict["tags"][0]["name"] + tag2 = petstore_api.Tag() + tag2.id = pet_dict["tags"][1]["id"] + tag2.name = pet_dict["tags"][1]["name"] + pet.tags = [tag1, tag2] + pet.status = pet_dict["status"] + + data = pet + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, pet_dict) + + # list of models + list_of_pet_dict = [pet_dict] + data = [pet] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, list_of_pet_dict) + + # model with additional proerties + model_dict = {'some_key': True} + model = petstore_api.StringBooleanMap(**model_dict) + result = self.api_client.sanitize_for_serialization(model) + self.assertEqual(result, model_dict) diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini new file mode 100644 index 000000000000..3d0be613cfc7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 45ff3402d25a..d443a4b3f0a4 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -193,6 +193,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## http_signature_test + +- **Type**: HTTP basic authentication + + ## petstore_auth - **Type**: OAuth diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 1c9522f71c58..2c8e2e27e134 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -32,11 +32,16 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the key used to sign HTTP requests + :param private_key_path: The path of the file containing a private key, used to sign HTTP requests + :param signing_algorithm: The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -65,6 +70,18 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests + """ self.access_token = "" """access token for OAuth/Bearer """ @@ -107,6 +124,10 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Set this to True/False to enable/disable SSL hostname verification. """ + self.private_key = None + """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. + """ + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is @@ -275,6 +296,13 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_basic_auth_token() }, + 'http_signature_test': + { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + }, 'petstore_auth': { 'type': 'oauth2', @@ -284,6 +312,7 @@ def auth_settings(self): }, } + def to_debug_report(self): """Gets the essential information for debugging. From 1ef838b6d77eb820d1102acd66d564674a58c610 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 6 Jan 2020 04:16:40 +0000 Subject: [PATCH 007/102] HTTP signature authentication --- .../src/main/java/org/openapitools/codegen/CodegenSecurity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index 0e2618ef5d98..f29003b48056 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -50,6 +50,7 @@ public CodegenSecurity filterByScopeNames(List filterScopes) { filteredSecurity.hasMore = false; filteredSecurity.isBasic = isBasic; filteredSecurity.isBasicBasic = isBasicBasic; + filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isBasicBearer = isBasicBearer; filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isApiKey = isApiKey; @@ -135,6 +136,7 @@ public String toString() { sb.append(", isOAuth=").append(isOAuth); sb.append(", isApiKey=").append(isApiKey); sb.append(", isBasicBasic=").append(isBasicBasic); + sb.append(", isHttpSignature=").append(isHttpSignature); sb.append(", isBasicBearer=").append(isBasicBearer); sb.append(", isHttpSignature=").append(isHttpSignature); sb.append(", bearerFormat='").append(bearerFormat).append('\''); From 3246c1d705475613a5650f5b5ae2ab71dfc13a4c Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sun, 29 Dec 2019 16:05:14 +0000 Subject: [PATCH 008/102] start implementation of HTTP signature --- .../resources/python/python-experimental/api_client.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index ef64540102ce..14d389a5d56f 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -708,4 +708,4 @@ class ApiClient(object): return auth_str -{{/hasHttpSignatureMethods}} \ No newline at end of file +{{/hasHttpSignatureMethods}} From 4b33ef8a7f0b245301aa417772d3b85d65fa73cb Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 6 Jan 2020 09:38:17 -0800 Subject: [PATCH 009/102] fix merge issues --- .../src/main/java/org/openapitools/codegen/CodegenSecurity.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index f29003b48056..65dfe5c8e491 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -52,7 +52,6 @@ public CodegenSecurity filterByScopeNames(List filterScopes) { filteredSecurity.isBasicBasic = isBasicBasic; filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isBasicBearer = isBasicBearer; - filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isApiKey = isApiKey; filteredSecurity.isOAuth = isOAuth; filteredSecurity.keyParamName = keyParamName; @@ -138,7 +137,6 @@ public String toString() { sb.append(", isBasicBasic=").append(isBasicBasic); sb.append(", isHttpSignature=").append(isHttpSignature); sb.append(", isBasicBearer=").append(isBasicBearer); - sb.append(", isHttpSignature=").append(isHttpSignature); sb.append(", bearerFormat='").append(bearerFormat).append('\''); sb.append(", vendorExtensions=").append(vendorExtensions); sb.append(", keyParamName='").append(keyParamName).append('\''); From 2d63a3acc498f486259c387582a57ae3e90b812e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 13:13:39 -0800 Subject: [PATCH 010/102] Address formatting issues --- .../main/resources/python/configuration.mustache | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 5e0ea41b33ea..d534fc72b179 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -31,10 +31,14 @@ class Configuration(object): :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - :param private_key_path: The path of the file containing a private key, when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. Supported values is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, + when signing HTTP requests. """ def __init__(self, host="{{{basePath}}}", @@ -136,7 +140,6 @@ class Configuration(object): self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - {{#hasHttpSignatureMethods}} self.private_key = None """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. @@ -343,8 +346,8 @@ class Configuration(object): {{/isOAuth}} {{/authMethods}} } - {{#hasHttpSignatureMethods}} + def load_private_key(self): """Load the private key used to sign HTTP requests. """ From 409ac382294bb62f9318cfb9044eb47c162889ca Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 13:14:25 -0800 Subject: [PATCH 011/102] Address formatting issues --- .../petstore_api/configuration.py | 29 +++++++++++++++++- .../python-experimental/docs/Player.md | 2 +- .../petstore_api/api_client.py | 10 +++++-- .../petstore_api/configuration.py | 29 +++++++++++++++++- .../petstore_api/models/player.py | 4 +-- .../petstore_api/configuration.py | 29 +++++++++++++++++- .../python/petstore_api/configuration.py | 30 ++++++++++++------- 7 files changed, 113 insertions(+), 20 deletions(-) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 92d2ba108e3b..f26151ba3252 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -31,11 +31,21 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, + when signing HTTP requests. """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -64,6 +74,23 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests. + """ self.access_token = "" """access token for OAuth/Bearer """ diff --git a/samples/client/petstore/python-experimental/docs/Player.md b/samples/client/petstore/python-experimental/docs/Player.md index 34adf5302a00..87c2c6b27ba4 100644 --- a/samples/client/petstore/python-experimental/docs/Player.md +++ b/samples/client/petstore/python-experimental/docs/Player.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | -**enemy_player** | [**Player**](Player.md) | | [optional] +**enemy_player** | [**player.Player**](Player.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 6673889b51f7..61773c8abe90 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from six.moves.urllib.parse import quote +from six.moves.urllib.parse import quote, urlencode, urlparse from petstore_api import rest from petstore_api.configuration import Configuration @@ -153,7 +153,7 @@ def __call_api( post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) + self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) # body if body: @@ -510,12 +510,15 @@ def select_header_content_type(self, content_types): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: The HTTP request resource path. + :method: The HTTP request method. + :body: The body of the HTTP request. """ if not auth_settings: return @@ -535,3 +538,4 @@ def update_params_for_auth(self, headers, querys, auth_settings): raise ApiValueError( 'Authentication token must be in `query` or `header`' ) + diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index f6f48362e579..495fedb65897 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -32,11 +32,21 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, + when signing HTTP requests. """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -65,6 +75,23 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests. + """ self.access_token = "" """access token for OAuth/Bearer """ diff --git a/samples/client/petstore/python-experimental/petstore_api/models/player.py b/samples/client/petstore/python-experimental/petstore_api/models/player.py index 75b3ca337674..c7266e840283 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/player.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/player.py @@ -74,7 +74,7 @@ def openapi_types(): """ return { 'name': (str,), # noqa: E501 - 'enemy_player': (Player,), # noqa: E501 + 'enemy_player': (player.Player,), # noqa: E501 } @staticmethod @@ -118,7 +118,7 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. - enemy_player (Player): [optional] # noqa: E501 + enemy_player (player.Player): [optional] # noqa: E501 """ self._data_store = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index f6f48362e579..495fedb65897 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -32,11 +32,21 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, + when signing HTTP requests. """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username="", password=""): + username="", password="", + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -65,6 +75,23 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + """ + self.signed_headers = signed_headers + """A list of HTTP headers that must be signed, when signing HTTP requests. + """ self.access_token = "" """access token for OAuth/Bearer """ diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index d9144f3901ca..495fedb65897 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -32,16 +32,21 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests - :param private_key_path: The path of the file containing a private key, when signing HTTP requests - :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 - :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, + when signing HTTP requests. """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -71,16 +76,21 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Password for HTTP basic authentication """ self.key_id = key_id - """The identifier of the key used to sign HTTP requests + """The identifier of the key used to sign HTTP requests. """ self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests + """A list of HTTP headers that must be signed, when signing HTTP requests. """ self.access_token = "" """access token for OAuth/Bearer @@ -124,7 +134,6 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Set this to True/False to enable/disable SSL hostname verification. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is @@ -294,7 +303,6 @@ def auth_settings(self): }, } - def to_debug_report(self): """Gets the essential information for debugging. From 2bf6f1a5a8fa121d1ec65121860f29f26bd59cee Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 13:36:02 -0800 Subject: [PATCH 012/102] move python-experimental-openapiv3-sample to a separate PR --- bin/openapi3/python-experimental-petstore.sh | 32 - .../petstore/python-experimental/.gitignore | 64 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/VERSION | 1 - .../petstore/python-experimental/.travis.yml | 14 - .../petstore/python-experimental/README.md | 216 -- .../docs/AdditionalPropertiesClass.md | 11 - .../python-experimental/docs/Animal.md | 11 - .../docs/AnotherFakeApi.md | 63 - .../python-experimental/docs/ApiResponse.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../docs/ArrayOfNumberOnly.md | 10 - .../python-experimental/docs/ArrayTest.md | 12 - .../docs/Capitalization.md | 15 - .../petstore/python-experimental/docs/Cat.md | 12 - .../python-experimental/docs/CatAllOf.md | 10 - .../python-experimental/docs/Category.md | 11 - .../python-experimental/docs/ClassModel.md | 11 - .../python-experimental/docs/Client.md | 10 - .../python-experimental/docs/DefaultApi.md | 56 - .../petstore/python-experimental/docs/Dog.md | 12 - .../python-experimental/docs/DogAllOf.md | 10 - .../python-experimental/docs/EnumArrays.md | 11 - .../python-experimental/docs/EnumClass.md | 10 - .../python-experimental/docs/EnumTest.md | 17 - .../python-experimental/docs/FakeApi.md | 828 ------- .../docs/FakeClassnameTags123Api.md | 71 - .../petstore/python-experimental/docs/File.md | 11 - .../docs/FileSchemaTestClass.md | 11 - .../petstore/python-experimental/docs/Foo.md | 10 - .../python-experimental/docs/FormatTest.md | 24 - .../docs/HasOnlyReadOnly.md | 11 - .../docs/HealthCheckResult.md | 11 - .../python-experimental/docs/InlineObject.md | 11 - .../python-experimental/docs/InlineObject1.md | 11 - .../python-experimental/docs/InlineObject2.md | 11 - .../python-experimental/docs/InlineObject3.md | 23 - .../python-experimental/docs/InlineObject4.md | 11 - .../python-experimental/docs/InlineObject5.md | 11 - .../docs/InlineResponseDefault.md | 10 - .../petstore/python-experimental/docs/List.md | 10 - .../python-experimental/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../docs/Model200Response.md | 12 - .../python-experimental/docs/ModelReturn.md | 11 - .../petstore/python-experimental/docs/Name.md | 14 - .../python-experimental/docs/NullableClass.md | 22 - .../python-experimental/docs/NumberOnly.md | 10 - .../python-experimental/docs/Order.md | 15 - .../docs/OuterComposite.md | 12 - .../python-experimental/docs/OuterEnum.md | 10 - .../docs/OuterEnumDefaultValue.md | 10 - .../docs/OuterEnumInteger.md | 10 - .../docs/OuterEnumIntegerDefaultValue.md | 10 - .../petstore/python-experimental/docs/Pet.md | 15 - .../python-experimental/docs/PetApi.md | 563 ----- .../python-experimental/docs/ReadOnlyFirst.md | 11 - .../docs/SpecialModelName.md | 10 - .../python-experimental/docs/StoreApi.md | 233 -- .../docs/StringBooleanMap.md | 10 - .../petstore/python-experimental/docs/Tag.md | 11 - .../petstore/python-experimental/docs/User.md | 17 - .../python-experimental/docs/UserApi.md | 437 ---- .../petstore/python-experimental/git_push.sh | 58 - .../petstore_api/__init__.py | 87 - .../petstore_api/api/__init__.py | 12 - .../petstore_api/api/another_fake_api.py | 375 --- .../petstore_api/api/default_api.py | 365 --- .../petstore_api/api/fake_api.py | 2016 ----------------- .../api/fake_classname_tags_123_api.py | 377 --- .../petstore_api/api/pet_api.py | 1292 ----------- .../petstore_api/api/store_api.py | 692 ------ .../petstore_api/api/user_api.py | 1111 --------- .../petstore_api/api_client.py | 698 ------ .../petstore_api/configuration.py | 436 ---- .../petstore_api/exceptions.py | 120 - .../petstore_api/model_utils.py | 876 ------- .../petstore_api/models/__init__.py | 66 - .../models/additional_properties_class.py | 252 --- .../petstore_api/models/animal.py | 270 --- .../petstore_api/models/api_response.py | 270 --- .../models/array_of_array_of_number_only.py | 234 -- .../models/array_of_number_only.py | 234 -- .../petstore_api/models/array_test.py | 271 --- .../petstore_api/models/capitalization.py | 326 --- .../petstore_api/models/cat.py | 272 --- .../petstore_api/models/cat_all_of.py | 234 -- .../petstore_api/models/category.py | 254 --- .../petstore_api/models/class_model.py | 234 -- .../petstore_api/models/client.py | 234 -- .../petstore_api/models/dog.py | 272 --- .../petstore_api/models/dog_all_of.py | 234 -- .../petstore_api/models/enum_arrays.py | 260 --- .../petstore_api/models/enum_class.py | 226 -- .../petstore_api/models/enum_test.py | 384 ---- .../petstore_api/models/file.py | 236 -- .../models/file_schema_test_class.py | 253 --- .../petstore_api/models/foo.py | 234 -- .../petstore_api/models/format_test.py | 536 ----- .../petstore_api/models/has_only_read_only.py | 252 --- .../models/health_check_result.py | 234 -- .../petstore_api/models/inline_object.py | 256 --- .../petstore_api/models/inline_object1.py | 256 --- .../petstore_api/models/inline_object2.py | 265 --- .../petstore_api/models/inline_object3.py | 535 ----- .../petstore_api/models/inline_object4.py | 259 --- .../petstore_api/models/inline_object5.py | 258 --- .../models/inline_response_default.py | 235 -- .../petstore_api/models/list.py | 234 -- .../petstore_api/models/map_test.py | 293 --- ...perties_and_additional_properties_class.py | 271 --- .../petstore_api/models/model200_response.py | 252 --- .../petstore_api/models/model_return.py | 234 -- .../petstore_api/models/name.py | 290 --- .../petstore_api/models/nullable_class.py | 432 ---- .../petstore_api/models/number_only.py | 234 -- .../petstore_api/models/order.py | 331 --- .../petstore_api/models/outer_composite.py | 270 --- .../petstore_api/models/outer_enum.py | 227 -- .../models/outer_enum_default_value.py | 226 -- .../petstore_api/models/outer_enum_integer.py | 226 -- .../outer_enum_integer_default_value.py | 226 -- .../petstore_api/models/pet.py | 336 --- .../petstore_api/models/read_only_first.py | 252 --- .../petstore_api/models/special_model_name.py | 234 -- .../petstore_api/models/string_boolean_map.py | 216 -- .../petstore_api/models/tag.py | 252 --- .../petstore_api/models/user.py | 362 --- .../python-experimental/petstore_api/rest.py | 296 --- .../python-experimental/requirements.txt | 6 - .../petstore/python-experimental/setup.py | 45 - .../python-experimental/test-requirements.txt | 7 - .../python-experimental/test/__init__.py | 0 .../test/test_additional_properties_class.py | 39 - .../python-experimental/test/test_animal.py | 39 - .../test/test_another_fake_api.py | 40 - .../test/test_api_response.py | 39 - .../test_array_of_array_of_number_only.py | 39 - .../test/test_array_of_number_only.py | 39 - .../test/test_array_test.py | 39 - .../test/test_capitalization.py | 39 - .../python-experimental/test/test_cat.py | 39 - .../test/test_cat_all_of.py | 39 - .../python-experimental/test/test_category.py | 39 - .../test/test_class_model.py | 39 - .../python-experimental/test/test_client.py | 39 - .../test/test_default_api.py | 39 - .../python-experimental/test/test_dog.py | 39 - .../test/test_dog_all_of.py | 39 - .../test/test_enum_arrays.py | 39 - .../test/test_enum_class.py | 39 - .../test/test_enum_test.py | 39 - .../python-experimental/test/test_fake_api.py | 124 - .../test/test_fake_classname_tags_123_api.py | 40 - .../python-experimental/test/test_file.py | 39 - .../test/test_file_schema_test_class.py | 39 - .../python-experimental/test/test_foo.py | 39 - .../test/test_format_test.py | 39 - .../test/test_has_only_read_only.py | 39 - .../test/test_health_check_result.py | 39 - .../test/test_inline_object.py | 39 - .../test/test_inline_object1.py | 39 - .../test/test_inline_object2.py | 39 - .../test/test_inline_object3.py | 39 - .../test/test_inline_object4.py | 39 - .../test/test_inline_object5.py | 39 - .../test/test_inline_response_default.py | 39 - .../python-experimental/test/test_list.py | 39 - .../python-experimental/test/test_map_test.py | 39 - ...perties_and_additional_properties_class.py | 39 - .../test/test_model200_response.py | 39 - .../test/test_model_return.py | 39 - .../python-experimental/test/test_name.py | 39 - .../test/test_nullable_class.py | 39 - .../test/test_number_only.py | 39 - .../python-experimental/test/test_order.py | 39 - .../test/test_outer_composite.py | 39 - .../test/test_outer_enum.py | 39 - .../test/test_outer_enum_default_value.py | 39 - .../test/test_outer_enum_integer.py | 39 - .../test_outer_enum_integer_default_value.py | 39 - .../python-experimental/test/test_pet.py | 39 - .../python-experimental/test/test_pet_api.py | 96 - .../test/test_read_only_first.py | 39 - .../test/test_special_model_name.py | 39 - .../test/test_store_api.py | 61 - .../test/test_string_boolean_map.py | 39 - .../python-experimental/test/test_tag.py | 39 - .../python-experimental/test/test_user.py | 39 - .../python-experimental/test/test_user_api.py | 89 - .../python-experimental/tests/__init__.py | 0 .../tests/test_api_client.py | 225 -- .../petstore/python-experimental/tox.ini | 10 - 193 files changed, 28484 deletions(-) delete mode 100755 bin/openapi3/python-experimental-petstore.sh delete mode 100644 samples/openapi3/client/petstore/python-experimental/.gitignore delete mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/python-experimental/.travis.yml delete mode 100644 samples/openapi3/client/petstore/python-experimental/README.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Animal.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Cat.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Category.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Client.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Dog.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/File.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Foo.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/List.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MapTest.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Name.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Order.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Pet.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/PetApi.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Tag.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/User.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/docs/UserApi.md delete mode 100644 samples/openapi3/client/petstore/python-experimental/git_push.sh delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/requirements.txt delete mode 100644 samples/openapi3/client/petstore/python-experimental/setup.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test-requirements.txt delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_animal.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_api_response.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_category.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_class_model.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_client.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_default_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_foo.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_format_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_list.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_map_test.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model_return.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_name.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_only.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_order.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_store_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_tag.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user_api.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/tests/__init__.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py delete mode 100644 samples/openapi3/client/petstore/python-experimental/tox.ini diff --git a/bin/openapi3/python-experimental-petstore.sh b/bin/openapi3/python-experimental-petstore.sh deleted file mode 100755 index 7b4007372b23..000000000000 --- a/bin/openapi3/python-experimental-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/petstore/python-experimental/.gitignore deleted file mode 100644 index a655050c2631..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/.gitignore +++ /dev/null @@ -1,64 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.python-version - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION deleted file mode 100644 index e4955748d3e7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml deleted file mode 100644 index 86211e2d4a26..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - #- "3.5-dev" # 3.5 development branch - #- "nightly" # points to the latest development branch e.g. 3.6-dev -# command to install dependencies -install: "pip install -r requirements.txt" -# command to run tests -script: nosetests diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md deleted file mode 100644 index 86cdecf7fd42..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# petstore-api -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 Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen - -## Requirements. - -Python 2.7 and 3.4+ - -## Installation & Usage -### pip install - -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) - -Then import the package: -```python -import petstore_api -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) - -Then import the package: -```python -import petstore_api -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) -client = petstore_api.Client() # Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | -*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | -*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*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 -*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 -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Foo](docs/Foo.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [InlineObject](docs/InlineObject.md) - - [InlineObject1](docs/InlineObject1.md) - - [InlineObject2](docs/InlineObject2.md) - - [InlineObject3](docs/InlineObject3.md) - - [InlineObject4](docs/InlineObject4.md) - - [InlineObject5](docs/InlineObject5.md) - - [InlineResponseDefault](docs/InlineResponseDefault.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [OuterEnumInteger](docs/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **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 - - -## bearer_test - -- **Type**: Bearer authentication (JWT) - - -## http_basic_test - -- **Type**: HTTP basic authentication - - -## http_signature_test - -- **Type**: HTTP basic authentication - - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md deleted file mode 100644 index beb2e2d4f1ed..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_property** | **{str: (str,)}** | | [optional] -**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md deleted file mode 100644 index e59166a62e83..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**color** | **str** | | [optional] if omitted the server will use the default value of 'red' - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md deleted file mode 100644 index 9e19b330e9a9..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ /dev/null @@ -1,63 +0,0 @@ -# petstore_api.AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call_123_test_special_tags** -> Client call_123_test_special_tags(client) - -To test special tags - -To test special tags and operation ID starting with number - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.AnotherFakeApi() -client = petstore_api.Client() # Client | client model - -try: - # To test special tags - api_response = api_instance.call_123_test_special_tags(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md deleted file mode 100644 index 8fc302305abe..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **str** | | [optional] -**message** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 1a68df0090bb..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_array_number** | **[[float]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md deleted file mode 100644 index b8a760f56dc2..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_number** | **[float]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md deleted file mode 100644 index c677e324ad47..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**array_of_string** | **[str]** | | [optional] -**array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | **[[ReadOnlyFirst]]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md deleted file mode 100644 index 85d88d239ee7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**small_camel** | **str** | | [optional] -**capital_camel** | **str** | | [optional] -**small_snake** | **str** | | [optional] -**capital_snake** | **str** | | [optional] -**sca_eth_flow_points** | **str** | | [optional] -**att_name** | **str** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md deleted file mode 100644 index 8bdbf9b3bcca..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md +++ /dev/null @@ -1,12 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**declawed** | **bool** | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of 'red' - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md deleted file mode 100644 index 35434374fc97..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md deleted file mode 100644 index 33b2242d703f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | defaults to 'default-name' -**id** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md deleted file mode 100644 index 657d51a944de..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md +++ /dev/null @@ -1,11 +0,0 @@ -# ClassModel - -Model for testing model with \"_class\" property -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md deleted file mode 100644 index 88e99384f92c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md deleted file mode 100644 index 92e27f40a24c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ /dev/null @@ -1,56 +0,0 @@ -# petstore_api.DefaultApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | - - -# **foo_get** -> InlineResponseDefault foo_get() - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.DefaultApi() - -try: - api_response = api_instance.foo_get() - pprint(api_response) -except ApiException as e: - print("Exception when calling DefaultApi->foo_get: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**InlineResponseDefault**](InlineResponseDefault.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | response | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md deleted file mode 100644 index 81de56780725..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md +++ /dev/null @@ -1,12 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_name** | **str** | | -**breed** | **str** | | [optional] -**color** | **str** | | [optional] if omitted the server will use the default value of 'red' - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md deleted file mode 100644 index 36d3216f7b35..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md deleted file mode 100644 index e0b5582e9d5b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_symbol** | **str** | | [optional] -**array_enum** | **[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md deleted file mode 100644 index 510dff4df0cf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md +++ /dev/null @@ -1,10 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | defaults to '-efg' - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md deleted file mode 100644 index 5e2263ee5e00..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md +++ /dev/null @@ -1,17 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string_required** | **str** | | -**enum_string** | **str** | | [optional] -**enum_integer** | **int** | | [optional] -**enum_number** | **float** | | [optional] -**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md deleted file mode 100644 index 2b503b7d4d8e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ /dev/null @@ -1,828 +0,0 @@ -# petstore_api.FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint -[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | -[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | -[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | -[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | -[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | -[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | -[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model -[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters -[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data -[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | - - -# **fake_health_get** -> HealthCheckResult fake_health_get() - -Health check endpoint - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() - -try: - # Health check endpoint - api_response = api_instance.fake_health_get() - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_health_get: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The instance started successfully | - | - -[[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) - -# **fake_outer_boolean_serialize** -> bool fake_outer_boolean_serialize() - - - -Test serialization of outer boolean types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = True # bool | Input boolean as post body (optional) - -try: - api_response = api_instance.fake_outer_boolean_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output boolean | - | - -[[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) - -# **fake_outer_composite_serialize** -> OuterComposite fake_outer_composite_serialize() - - - -Test serialization of object with outer number type - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) - -try: - api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output composite | - | - -[[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) - -# **fake_outer_number_serialize** -> float fake_outer_number_serialize() - - - -Test serialization of outer number types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 3.4 # float | Input number as post body (optional) - -try: - api_response = api_instance.fake_outer_number_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **float**| Input number as post body | [optional] - -### Return type - -**float** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output number | - | - -[[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) - -# **fake_outer_string_serialize** -> str fake_outer_string_serialize() - - - -Test serialization of outer string types - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -body = 'body_example' # str | Input string as post body (optional) - -try: - api_response = api_instance.fake_outer_string_serialize(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **str**| Input string as post body | [optional] - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Output string | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_file_schema** -> test_body_with_file_schema(file_schema_test_class) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | - -try: - api_instance.test_body_with_file_schema(file_schema_test_class) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_body_with_query_params** -> test_body_with_query_params(query, user) - - - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -query = 'query_example' # str | -user = petstore_api.User() # User | - -try: - api_instance.test_body_with_query_params(query, user) -except ApiException as e: - print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **str**| | - **user** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_client_model** -> Client test_client_model(client) - -To test \"client\" model - -To test \"client\" model - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -client = petstore_api.Client() # Client | client model - -try: - # To test \"client\" model - api_response = api_instance.test_client_model(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeApi->test_client_model: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_endpoint_parameters** -> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example - -* Basic Authentication (http_basic_test): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -number = 3.4 # float | None -double = 3.4 # float | None -pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None -byte = 'byte_example' # str | None -integer = 56 # int | None (optional) -int32 = 56 # int | None (optional) -int64 = 56 # int | None (optional) -float = 3.4 # float | None (optional) -string = 'string_example' # str | None (optional) -binary = open('/path/to/file', 'rb') # file_type | None (optional) -date = '2013-10-20' # date | None (optional) -date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) -password = 'password_example' # str | None (optional) -param_callback = 'param_callback_example' # str | None (optional) - -try: - # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) -except ApiException as e: - print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **float**| None | - **double** | **float**| None | - **pattern_without_delimiter** | **str**| None | - **byte** | **str**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **float**| None | [optional] - **string** | **str**| None | [optional] - **binary** | **file_type**| None | [optional] - **date** | **date**| None | [optional] - **date_time** | **datetime**| None | [optional] - **password** | **str**| None | [optional] - **param_callback** | **str**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_enum_parameters** -> test_enum_parameters() - -To test enum parameters - -To test enum parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') -enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') -enum_query_integer = 56 # int | Query parameter enum test (double) (optional) -enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # [str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') - -try: - # To test enum parameters - api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) -except ApiException as e: - print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enum_header_string_array** | [**[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' - **enum_query_string_array** | [**[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' - **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] - **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**[str]**](str.md)| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of '$' - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid request | - | -**404** | Not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_group_parameters** -> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example - -* Bearer (JWT) Authentication (bearer_test): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure Bearer authorization (JWT): bearer_test -configuration.access_token = 'YOUR_BEARER_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) -required_string_group = 56 # int | Required String in group parameters -required_boolean_group = True # bool | Required Boolean in group parameters -required_int64_group = 56 # int | Required Integer in group parameters -string_group = 56 # int | String in group parameters (optional) -boolean_group = True # bool | Boolean in group parameters (optional) -int64_group = 56 # int | Integer in group parameters (optional) - -try: - # Fake endpoint to test group parameters (optional) - api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) -except ApiException as e: - print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **required_string_group** | **int**| Required String in group parameters | - **required_boolean_group** | **bool**| Required Boolean in group parameters | - **required_int64_group** | **int**| Required Integer in group parameters | - **string_group** | **int**| String in group parameters | [optional] - **boolean_group** | **bool**| Boolean in group parameters | [optional] - **int64_group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Someting wrong | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_inline_additional_properties** -> test_inline_additional_properties(request_body) - -test inline additionalProperties - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -request_body = {'key': 'request_body_example'} # {str: (str,)} | request body - -try: - # test inline additionalProperties - api_instance.test_inline_additional_properties(request_body) -except ApiException as e: - print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_body** | [**{str: (str,)}**](str.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_json_form_data** -> test_json_form_data(param, param2) - -test json serialization of form data - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -param = 'param_example' # str | field1 -param2 = 'param2_example' # str | field2 - -try: - # test json serialization of form data - api_instance.test_json_form_data(param, param2) -except ApiException as e: - print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **str**| field1 | - **param2** | **str**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **test_query_parameter_collection_format** -> test_query_parameter_collection_format(pipe, ioutil, http, url, context) - - - -To test the collection format in query parameters - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.FakeApi() -pipe = ['pipe_example'] # [str] | -ioutil = ['ioutil_example'] # [str] | -http = ['http_example'] # [str] | -url = ['url_example'] # [str] | -context = ['context_example'] # [str] | - -try: - api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) -except ApiException as e: - print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**[str]**](str.md)| | - **ioutil** | [**[str]**](str.md)| | - **http** | [**[str]**](str.md)| | - **url** | [**[str]**](str.md)| | - **context** | [**[str]**](str.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md deleted file mode 100644 index de59ba0d374f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,71 +0,0 @@ -# petstore_api.FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **test_classname** -> Client test_classname(client) - -To test class name in snake case - -To test class name in snake case - -### Example - -* Api Key Authentication (api_key_query): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure API key authorization: api_key_query -configuration.api_key['api_key_query'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key_query'] = 'Bearer' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) -client = petstore_api.Client() # Client | client model - -try: - # To test class name in snake case - api_response = api_instance.test_classname(client) - pprint(api_response) -except ApiException as e: - print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **client** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md deleted file mode 100644 index f17ba0057d04..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/File.md +++ /dev/null @@ -1,11 +0,0 @@ -# File - -Must be named `File` for test. -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_uri** | **str** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md deleted file mode 100644 index d0a8bbaaba95..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [**[File]**](File.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md deleted file mode 100644 index 5b281fa08de7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md +++ /dev/null @@ -1,10 +0,0 @@ -# Foo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] if omitted the server will use the default value of 'bar' - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md deleted file mode 100644 index 2ac0ffb36d33..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md +++ /dev/null @@ -1,24 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | **float** | | -**byte** | **str** | | -**date** | **date** | | -**password** | **str** | | -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**float** | **float** | | [optional] -**double** | **float** | | [optional] -**string** | **str** | | [optional] -**binary** | **file_type** | | [optional] -**date_time** | **datetime** | | [optional] -**uuid** | **str** | | [optional] -**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md deleted file mode 100644 index f731a42eab54..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**foo** | **str** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md deleted file mode 100644 index 50cf84f69133..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md +++ /dev/null @@ -1,11 +0,0 @@ -# HealthCheckResult - -Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nullable_message** | **str, none_type** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md deleted file mode 100644 index f567ea188ce0..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | Updated name of the pet | [optional] -**status** | **str** | Updated status of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md deleted file mode 100644 index 4349ad73e3b7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additional_metadata** | **str** | Additional data to pass to server | [optional] -**file** | **file_type** | file to upload | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md deleted file mode 100644 index 106488e8598e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject2 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md deleted file mode 100644 index 7a73a2c686b9..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md +++ /dev/null @@ -1,23 +0,0 @@ -# InlineObject3 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**number** | **float** | None | -**double** | **float** | None | -**pattern_without_delimiter** | **str** | None | -**byte** | **str** | None | -**integer** | **int** | None | [optional] -**int32** | **int** | None | [optional] -**int64** | **int** | None | [optional] -**float** | **float** | None | [optional] -**string** | **str** | None | [optional] -**binary** | **file_type** | None | [optional] -**date** | **date** | None | [optional] -**date_time** | **datetime** | None | [optional] -**password** | **str** | None | [optional] -**callback** | **str** | None | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md deleted file mode 100644 index 07574d0d0769..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject4 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **str** | field1 | -**param2** | **str** | field2 | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md deleted file mode 100644 index 8f8662c434db..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineObject5 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**required_file** | **file_type** | file to upload | -**additional_metadata** | **str** | Additional data to pass to server | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md deleted file mode 100644 index 9c754420f24a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponseDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-experimental/docs/List.md deleted file mode 100644 index 11f4f3a05f32..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123_list** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md deleted file mode 100644 index ad561b7220bf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] -**map_of_enum_string** | **{str: (str,)}** | | [optional] -**direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index 1484c0638d83..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **str** | | [optional] -**date_time** | **datetime** | | [optional] -**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md deleted file mode 100644 index 40d0d7828e14..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md +++ /dev/null @@ -1,12 +0,0 @@ -# Model200Response - -Model for testing model name starting with number -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**_class** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md deleted file mode 100644 index 65ec73ddae78..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md +++ /dev/null @@ -1,11 +0,0 @@ -# ModelReturn - -Model for testing reserved words -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md deleted file mode 100644 index 807b76afc6ee..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Name.md +++ /dev/null @@ -1,14 +0,0 @@ -# Name - -Model for testing model name same as property name -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snake_case** | **int** | | [optional] [readonly] -**_property** | **str** | | [optional] -**_123_number** | **int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md deleted file mode 100644 index 8d6bd66098bc..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md +++ /dev/null @@ -1,22 +0,0 @@ -# NullableClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer_prop** | **int, none_type** | | [optional] -**number_prop** | **float, none_type** | | [optional] -**boolean_prop** | **bool, none_type** | | [optional] -**string_prop** | **str, none_type** | | [optional] -**date_prop** | **date, none_type** | | [optional] -**datetime_prop** | **datetime, none_type** | | [optional] -**array_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str], none_type** | | [optional] -**array_and_items_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str, none_type], none_type** | | [optional] -**array_items_nullable** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [optional] -**object_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str,)}, none_type** | | [optional] -**object_and_items_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] -**object_items_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] -**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md deleted file mode 100644 index 93a0fde7b931..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**just_number** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md deleted file mode 100644 index c21210a3bd59..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**pet_id** | **int** | | [optional] -**quantity** | **int** | | [optional] -**ship_date** | **datetime** | | [optional] -**status** | **str** | Order Status | [optional] -**complete** | **bool** | | [optional] if omitted the server will use the default value of False - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md deleted file mode 100644 index bab07ad559eb..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**my_number** | **float** | | [optional] -**my_string** | **str** | | [optional] -**my_boolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md deleted file mode 100644 index 7ddfca906e90..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str, none_type** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md deleted file mode 100644 index 2d5a02f98f38..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnumDefaultValue - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **str** | | defaults to 'placed' - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md deleted file mode 100644 index 21e90bebf945..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnumInteger - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **int** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index e8994703c347..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,10 +0,0 @@ -# OuterEnumIntegerDefaultValue - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **int** | | defaults to 0 - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md deleted file mode 100644 index ce09d401c899..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | -**photo_urls** | **[str]** | | -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**[Tag]**](Tag.md) | | [optional] -**status** | **str** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md deleted file mode 100644 index 0c5c6364803c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ /dev/null @@ -1,563 +0,0 @@ -# petstore_api.PetApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status -[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags -[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -[**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) - - -# **add_pet** -> add_pet(pet) - -Add a new pet to the store - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - -try: - # Add a new pet to the store - api_instance.add_pet(pet) -except ApiException as e: - print("Exception when calling PetApi->add_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[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) - -# **delete_pet** -> delete_pet(pet_id) - -Deletes a pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | Pet id to delete -api_key = 'api_key_example' # str | (optional) - -try: - # Deletes a pet - api_instance.delete_pet(pet_id, api_key=api_key) -except ApiException as e: - print("Exception when calling PetApi->delete_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **str**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid pet value | - | - -[[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) - -# **find_pets_by_status** -> [Pet] find_pets_by_status(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -status = ['status_example'] # [str] | Status values that need to be considered for filter - -try: - # Finds Pets by status - api_response = api_instance.find_pets_by_status(status) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[str]**](str.md)| Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid status value | - | - -[[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) - -# **find_pets_by_tags** -> [Pet] find_pets_by_tags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -tags = ['tags_example'] # [str] | Tags to filter by - -try: - # Finds Pets by tags - api_response = api_instance.find_pets_by_tags(tags) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[str]**](str.md)| Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid tag value | - | - -[[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) - -# **get_pet_by_id** -> Pet get_pet_by_id(pet_id) - -Find pet by ID - -Returns a single pet - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to return - -try: - # Find pet by ID - api_response = api_instance.get_pet_by_id(pet_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | - -[[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) - -Update an existing pet - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store - -try: - # Update an existing pet - api_instance.update_pet(pet) -except ApiException as e: - print("Exception when calling PetApi->update_pet: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Pet not found | - | -**405** | Validation exception | - | - -[[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_with_form** -> update_pet_with_form(pet_id) - -Updates a pet in the store with form data - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet that needs to be updated -name = 'name_example' # str | Updated name of the pet (optional) -status = 'status_example' # str | Updated status of the pet (optional) - -try: - # Updates a pet in the store with form data - api_instance.update_pet_with_form(pet_id, name=name, status=status) -except ApiException as e: - print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet that needs to be updated | - **name** | **str**| Updated name of the pet | [optional] - **status** | **str**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**405** | Invalid input | - | - -[[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) - -# **upload_file** -> ApiResponse upload_file(pet_id) - -uploads an image - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) -file = open('/path/to/file', 'rb') # file_type | file to upload (optional) - -try: - # uploads an image - api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **additional_metadata** | **str**| Additional data to pass to server | [optional] - **file** | **file_type**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[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) - -# **upload_file_with_required_file** -> ApiResponse upload_file_with_required_file(pet_id, required_file) - -uploads an image (required) - -### Example - -* OAuth Authentication (petstore_auth): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) -pet_id = 56 # int | ID of pet to update -required_file = open('/path/to/file', 'rb') # file_type | file to upload -additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) - -try: - # uploads an image (required) - api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) - pprint(api_response) -except ApiException as e: - print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| ID of pet to update | - **required_file** | **file_type**| file to upload | - **additional_metadata** | **str**| 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 - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md deleted file mode 100644 index 6bc1447c1d71..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [readonly] -**baz** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md deleted file mode 100644 index 022ee19169ce..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**special_property_name** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md deleted file mode 100644 index 3ffdb4942432..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ /dev/null @@ -1,233 +0,0 @@ -# petstore_api.StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet - - -# **delete_order** -> delete_order(order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 'order_id_example' # str | ID of the order that needs to be deleted - -try: - # Delete purchase order by ID - api_instance.delete_order(order_id) -except ApiException as e: - print("Exception when calling StoreApi->delete_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **str**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[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) - -# **get_inventory** -> {str: (int,)} get_inventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example - -* Api Key Authentication (api_key): -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint -configuration = petstore_api.Configuration() -# Configure API key authorization: api_key -configuration.api_key['api_key'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['api_key'] = 'Bearer' - -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -configuration.host = "http://petstore.swagger.io:80/v2" -# Create an instance of the API class -api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) - -try: - # Returns pet inventories by status - api_response = api_instance.get_inventory() - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_inventory: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**{str: (int,)}** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | - -[[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) - -# **get_order_by_id** -> Order get_order_by_id(order_id) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order_id = 56 # int | ID of pet that needs to be fetched - -try: - # Find purchase order by ID - api_response = api_instance.get_order_by_id(order_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order_id** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid ID supplied | - | -**404** | Order not found | - | - -[[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** -> Order place_order(order) - -Place an order for a pet - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.StoreApi() -order = petstore_api.Order() # Order | order placed for purchasing the pet - -try: - # Place an order for a pet - api_response = api_instance.place_order(order) - pprint(api_response) -except ApiException as e: - print("Exception when calling StoreApi->place_order: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid Order | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md deleted file mode 100644 index 2fbf3b3767d0..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md +++ /dev/null @@ -1,10 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md deleted file mode 100644 index 243cd98eda69..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md deleted file mode 100644 index 443ac123fdca..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **str** | | [optional] -**first_name** | **str** | | [optional] -**last_name** | **str** | | [optional] -**email** | **str** | | [optional] -**password** | **str** | | [optional] -**phone** | **str** | | [optional] -**user_status** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md deleted file mode 100644 index b5b208e87bb2..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ /dev/null @@ -1,437 +0,0 @@ -# petstore_api.UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_user**](UserApi.md#create_user) | **POST** /user | Create user -[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system -[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user - - -# **create_user** -> create_user(user) - -Create user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user = petstore_api.User() # User | Created user object - -try: - # Create user - api_instance.create_user(user) -except ApiException as e: - print("Exception when calling UserApi->create_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[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) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user = [petstore_api.User()] # [User] | List of user object - -try: - # Creates list of users with given input array - api_instance.create_users_with_array_input(user) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[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) - -Creates list of users with given input array - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() -user = [petstore_api.User()] # [User] | List of user object - -try: - # Creates list of users with given input array - api_instance.create_users_with_list_input(user) -except ApiException as e: - print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**[User]**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[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) - -# **delete_user** -> delete_user(username) - -Delete user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be deleted - -try: - # Delete user - api_instance.delete_user(username) -except ApiException as e: - print("Exception when calling UserApi->delete_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[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) - -# **get_user_by_name** -> User get_user_by_name(username) - -Get user by user name - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. - -try: - # Get user by user name - api_response = api_instance.get_user_by_name(username) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->get_user_by_name: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | - | -**400** | Invalid username supplied | - | -**404** | User not found | - | - -[[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) - -# **login_user** -> str login_user(username, password) - -Logs user into the system - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | The user name for login -password = 'password_example' # str | The password for login in clear text - -try: - # Logs user into the system - api_response = api_instance.login_user(username, password) - pprint(api_response) -except ApiException as e: - print("Exception when calling UserApi->login_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| The user name for login | - **password** | **str**| The password for login in clear text | - -### Return type - -**str** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| -**400** | Invalid username/password supplied | - | - -[[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) - -# **logout_user** -> logout_user() - -Logs out current logged in user session - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() - -try: - # Logs out current logged in user session - api_instance.logout_user() -except ApiException as e: - print("Exception when calling UserApi->logout_user: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**0** | successful operation | - | - -[[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, user) - -Updated user - -This can only be done by the logged in user. - -### Example - -```python -from __future__ import print_function -import time -import petstore_api -from petstore_api.rest import ApiException -from pprint import pprint - -# Create an instance of the API class -api_instance = petstore_api.UserApi() -username = 'username_example' # str | name that need to be deleted -user = petstore_api.User() # User | Updated user object - -try: - # Updated user - api_instance.update_user(username, user) -except ApiException as e: - print("Exception when calling UserApi->update_user: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **str**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**400** | Invalid user supplied | - | -**404** | User not found | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-experimental/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/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" - -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" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -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. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -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 - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -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" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py deleted file mode 100644 index 49b0eeb464ea..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -__version__ = "1.0.0" - -# import apis into sdk package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi - -# import ApiClient -from petstore_api.api_client import ApiClient -from petstore_api.configuration import Configuration -from petstore_api.exceptions import OpenApiException -from petstore_api.exceptions import ApiTypeError -from petstore_api.exceptions import ApiValueError -from petstore_api.exceptions import ApiKeyError -from petstore_api.exceptions import ApiException -# import models into sdk package -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.foo import Foo -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.health_check_result import HealthCheckResult -from petstore_api.models.inline_object import InlineObject -from petstore_api.models.inline_object1 import InlineObject1 -from petstore_api.models.inline_object2 import InlineObject2 -from petstore_api.models.inline_object3 import InlineObject3 -from petstore_api.models.inline_object4 import InlineObject4 -from petstore_api.models.inline_object5 import InlineObject5 -from petstore_api.models.inline_response_default import InlineResponseDefault -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.nullable_class import NullableClass -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue -from petstore_api.models.outer_enum_integer import OuterEnumInteger -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.string_boolean_map import StringBooleanMap -from petstore_api.models.tag import Tag -from petstore_api.models.user import User - diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py deleted file mode 100644 index fa4e54a80091..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -from __future__ import absolute_import - -# flake8: noqa - -# import apis into api package -from petstore_api.api.another_fake_api import AnotherFakeApi -from petstore_api.api.default_api import DefaultApi -from petstore_api.api.fake_api import FakeApi -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api -from petstore_api.api.pet_api import PetApi -from petstore_api.api.store_api import StoreApi -from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py deleted file mode 100644 index 89594ed2adbc..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ /dev/null @@ -1,375 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError -) -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - int, - none_type, - str, - validate_and_convert_types -) -from petstore_api.models.client import Client - - -class AnotherFakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __call_123_test_special_tags(self, client, **kwargs): # noqa: E501 - """To test special tags # noqa: E501 - - To test special tags and operation ID starting with number # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.call_123_test_special_tags(client, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param Client client: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['client'] = client - return self.call_with_http_info(**kwargs) - - self.call_123_test_special_tags = Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/another-fake/dummy', - 'operation_id': 'call_123_test_special_tags', - 'http_method': 'PATCH', - 'servers': [], - }, - params_map={ - 'all': [ - 'client', - ], - 'required': [ - 'client', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client': (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'client': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__call_123_test_special_tags - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (int,), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param] - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in six.iteritems(kwargs): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in six.iteritems(kwargs): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - pet_api = PetApi() - pet_api.add_pet # this is an instance of the class Endpoint - pet_api.add_pet() # this invokes pet_api.add_pet.__call__() - which then invokes the callable functions stored in that endpoint at - pet_api.add_pet.callable or self.callable in this class - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - _host = self.settings['servers'][kwargs['_host_index']] - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in six.iteritems(kwargs): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py deleted file mode 100644 index bbd4f2584287..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py +++ /dev/null @@ -1,365 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError -) -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - int, - none_type, - str, - validate_and_convert_types -) -from petstore_api.models.inline_response_default import InlineResponseDefault - - -class DefaultApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __foo_get(self, **kwargs): # noqa: E501 - """foo_get # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.foo_get(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: InlineResponseDefault - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.foo_get = Endpoint( - settings={ - 'response_type': (InlineResponseDefault,), - 'auth': [], - 'endpoint_path': '/foo', - 'operation_id': 'foo_get', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__foo_get - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (int,), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param] - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in six.iteritems(kwargs): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in six.iteritems(kwargs): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - pet_api = PetApi() - pet_api.add_pet # this is an instance of the class Endpoint - pet_api.add_pet() # this invokes pet_api.add_pet.__call__() - which then invokes the callable functions stored in that endpoint at - pet_api.add_pet.callable or self.callable in this class - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - _host = self.settings['servers'][kwargs['_host_index']] - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in six.iteritems(kwargs): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py deleted file mode 100644 index a50900f88f99..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ /dev/null @@ -1,2016 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError -) -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - int, - none_type, - str, - validate_and_convert_types -) -from petstore_api.models.client import Client -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.health_check_result import HealthCheckResult -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.user import User - - -class FakeApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __fake_health_get(self, **kwargs): # noqa: E501 - """Health check endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_health_get(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: HealthCheckResult - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.fake_health_get = Endpoint( - settings={ - 'response_type': (HealthCheckResult,), - 'auth': [], - 'endpoint_path': '/fake/health', - 'operation_id': 'fake_health_get', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__fake_health_get - ) - - def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 - """fake_outer_boolean_serialize # noqa: E501 - - Test serialization of outer boolean types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_boolean_serialize(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param bool body: Input boolean as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: bool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.fake_outer_boolean_serialize = Endpoint( - settings={ - 'response_type': (bool,), - 'auth': [], - 'endpoint_path': '/fake/outer/boolean', - 'operation_id': 'fake_outer_boolean_serialize', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': (bool,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__fake_outer_boolean_serialize - ) - - def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 - """fake_outer_composite_serialize # noqa: E501 - - Test serialization of object with outer number type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_composite_serialize(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param OuterComposite outer_composite: Input composite as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: OuterComposite - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.fake_outer_composite_serialize = Endpoint( - settings={ - 'response_type': (OuterComposite,), - 'auth': [], - 'endpoint_path': '/fake/outer/composite', - 'operation_id': 'fake_outer_composite_serialize', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'outer_composite', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'outer_composite': (OuterComposite,), - }, - 'attribute_map': { - }, - 'location_map': { - 'outer_composite': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__fake_outer_composite_serialize - ) - - def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 - """fake_outer_number_serialize # noqa: E501 - - Test serialization of outer number types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_number_serialize(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param float body: Input number as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: float - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.fake_outer_number_serialize = Endpoint( - settings={ - 'response_type': (float,), - 'auth': [], - 'endpoint_path': '/fake/outer/number', - 'operation_id': 'fake_outer_number_serialize', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': (float,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__fake_outer_number_serialize - ) - - def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 - """fake_outer_string_serialize # noqa: E501 - - Test serialization of outer string types # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.fake_outer_string_serialize(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str body: Input string as post body - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.fake_outer_string_serialize = Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/fake/outer/string', - 'operation_id': 'fake_outer_string_serialize', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'body', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'body': (str,), - }, - 'attribute_map': { - }, - 'location_map': { - 'body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - '*/*' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__fake_outer_string_serialize - ) - - def __test_body_with_file_schema(self, file_schema_test_class, **kwargs): # noqa: E501 - """test_body_with_file_schema # noqa: E501 - - For this test, the body for this request much reference a schema named `File`. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param FileSchemaTestClass file_schema_test_class: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['file_schema_test_class'] = file_schema_test_class - return self.call_with_http_info(**kwargs) - - self.test_body_with_file_schema = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-file-schema', - 'operation_id': 'test_body_with_file_schema', - 'http_method': 'PUT', - 'servers': [], - }, - params_map={ - 'all': [ - 'file_schema_test_class', - ], - 'required': [ - 'file_schema_test_class', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'file_schema_test_class': (FileSchemaTestClass,), - }, - 'attribute_map': { - }, - 'location_map': { - 'file_schema_test_class': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__test_body_with_file_schema - ) - - def __test_body_with_query_params(self, query, user, **kwargs): # noqa: E501 - """test_body_with_query_params # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_query_params(query, user, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str query: (required) - :param User user: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['query'] = query - kwargs['user'] = user - return self.call_with_http_info(**kwargs) - - self.test_body_with_query_params = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/body-with-query-params', - 'operation_id': 'test_body_with_query_params', - 'http_method': 'PUT', - 'servers': [], - }, - params_map={ - 'all': [ - 'query', - 'user', - ], - 'required': [ - 'query', - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'query': (str,), - 'user': (User,), - }, - 'attribute_map': { - 'query': 'query', - }, - 'location_map': { - 'query': 'query', - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__test_body_with_query_params - ) - - def __test_client_model(self, client, **kwargs): # noqa: E501 - """To test \"client\" model # noqa: E501 - - To test \"client\" model # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_client_model(client, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param Client client: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['client'] = client - return self.call_with_http_info(**kwargs) - - self.test_client_model = Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_client_model', - 'http_method': 'PATCH', - 'servers': [], - }, - params_map={ - 'all': [ - 'client', - ], - 'required': [ - 'client', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client': (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'client': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__test_client_model - ) - - def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 - """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param float number: None (required) - :param float double: None (required) - :param str pattern_without_delimiter: None (required) - :param str byte: None (required) - :param int integer: None - :param int int32: None - :param int int64: None - :param float float: None - :param str string: None - :param file_type binary: None - :param date date: None - :param datetime date_time: None - :param str password: None - :param str param_callback: None - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['number'] = number - kwargs['double'] = double - kwargs['pattern_without_delimiter'] = pattern_without_delimiter - kwargs['byte'] = byte - return self.call_with_http_info(**kwargs) - - self.test_endpoint_parameters = Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'http_basic_test' - ], - 'endpoint_path': '/fake', - 'operation_id': 'test_endpoint_parameters', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - 'integer', - 'int32', - 'int64', - 'float', - 'string', - 'binary', - 'date', - 'date_time', - 'password', - 'param_callback', - ], - 'required': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'byte', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'number', - 'double', - 'pattern_without_delimiter', - 'integer', - 'int32', - 'float', - 'string', - 'password', - ] - }, - root_map={ - 'validations': { - ('number',): { - - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('double',): { - - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('pattern_without_delimiter',): { - - 'regex': { - 'pattern': r'^[A-Z].*', # noqa: E501 - }, - }, - ('integer',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('float',): { - - 'inclusive_maximum': 987.6, - }, - ('string',): { - - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'number': (float,), - 'double': (float,), - 'pattern_without_delimiter': (str,), - 'byte': (str,), - 'integer': (int,), - 'int32': (int,), - 'int64': (int,), - 'float': (float,), - 'string': (str,), - 'binary': (file_type,), - 'date': (date,), - 'date_time': (datetime,), - 'password': (str,), - 'param_callback': (str,), - }, - 'attribute_map': { - 'number': 'number', - 'double': 'double', - 'pattern_without_delimiter': 'pattern_without_delimiter', - 'byte': 'byte', - 'integer': 'integer', - 'int32': 'int32', - 'int64': 'int64', - 'float': 'float', - 'string': 'string', - 'binary': 'binary', - 'date': 'date', - 'date_time': 'dateTime', - 'password': 'password', - 'param_callback': 'callback', - }, - 'location_map': { - 'number': 'form', - 'double': 'form', - 'pattern_without_delimiter': 'form', - 'byte': 'form', - 'integer': 'form', - 'int32': 'form', - 'int64': 'form', - 'float': 'form', - 'string': 'form', - 'binary': 'form', - 'date': 'form', - 'date_time': 'form', - 'password': 'form', - 'param_callback': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client, - callable=__test_endpoint_parameters - ) - - def __test_enum_parameters(self, **kwargs): # noqa: E501 - """To test enum parameters # noqa: E501 - - To test enum parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_enum_parameters(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param [str] enum_header_string_array: Header parameter enum test (string array) - :param str enum_header_string: Header parameter enum test (string) - :param [str] enum_query_string_array: Query parameter enum test (string array) - :param str enum_query_string: Query parameter enum test (string) - :param int enum_query_integer: Query parameter enum test (double) - :param float enum_query_double: Query parameter enum test (double) - :param [str] enum_form_string_array: Form parameter enum test (string array) - :param str enum_form_string: Form parameter enum test (string) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.test_enum_parameters = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake', - 'operation_id': 'test_enum_parameters', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - 'enum_header_string_array', - 'enum_header_string', - 'enum_query_string_array', - 'enum_query_string', - 'enum_query_integer', - 'enum_query_double', - 'enum_form_string_array', - 'enum_form_string', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('enum_header_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_header_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_query_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - ('enum_query_integer',): { - - "1": 1, - "-2": -2 - }, - ('enum_query_double',): { - - "1.1": 1.1, - "-1.2": -1.2 - }, - ('enum_form_string_array',): { - - ">": ">", - "$": "$" - }, - ('enum_form_string',): { - - "_ABC": "_abc", - "-EFG": "-efg", - "(XYZ)": "(xyz)" - }, - }, - 'openapi_types': { - 'enum_header_string_array': ([str],), - 'enum_header_string': (str,), - 'enum_query_string_array': ([str],), - 'enum_query_string': (str,), - 'enum_query_integer': (int,), - 'enum_query_double': (float,), - 'enum_form_string_array': ([str],), - 'enum_form_string': (str,), - }, - 'attribute_map': { - 'enum_header_string_array': 'enum_header_string_array', - 'enum_header_string': 'enum_header_string', - 'enum_query_string_array': 'enum_query_string_array', - 'enum_query_string': 'enum_query_string', - 'enum_query_integer': 'enum_query_integer', - 'enum_query_double': 'enum_query_double', - 'enum_form_string_array': 'enum_form_string_array', - 'enum_form_string': 'enum_form_string', - }, - 'location_map': { - 'enum_header_string_array': 'header', - 'enum_header_string': 'header', - 'enum_query_string_array': 'query', - 'enum_query_string': 'query', - 'enum_query_integer': 'query', - 'enum_query_double': 'query', - 'enum_form_string_array': 'form', - 'enum_form_string': 'form', - }, - 'collection_format_map': { - 'enum_header_string_array': 'csv', - 'enum_query_string_array': 'multi', - 'enum_form_string_array': 'csv', - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client, - callable=__test_enum_parameters - ) - - def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 - """Fake endpoint to test group parameters (optional) # noqa: E501 - - Fake endpoint to test group parameters (optional) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param int required_string_group: Required String in group parameters (required) - :param bool required_boolean_group: Required Boolean in group parameters (required) - :param int required_int64_group: Required Integer in group parameters (required) - :param int string_group: String in group parameters - :param bool boolean_group: Boolean in group parameters - :param int int64_group: Integer in group parameters - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['required_string_group'] = required_string_group - kwargs['required_boolean_group'] = required_boolean_group - kwargs['required_int64_group'] = required_int64_group - return self.call_with_http_info(**kwargs) - - self.test_group_parameters = Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'bearer_test' - ], - 'endpoint_path': '/fake', - 'operation_id': 'test_group_parameters', - 'http_method': 'DELETE', - 'servers': [], - }, - params_map={ - 'all': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - 'string_group', - 'boolean_group', - 'int64_group', - ], - 'required': [ - 'required_string_group', - 'required_boolean_group', - 'required_int64_group', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'required_string_group': (int,), - 'required_boolean_group': (bool,), - 'required_int64_group': (int,), - 'string_group': (int,), - 'boolean_group': (bool,), - 'int64_group': (int,), - }, - 'attribute_map': { - 'required_string_group': 'required_string_group', - 'required_boolean_group': 'required_boolean_group', - 'required_int64_group': 'required_int64_group', - 'string_group': 'string_group', - 'boolean_group': 'boolean_group', - 'int64_group': 'int64_group', - }, - 'location_map': { - 'required_string_group': 'query', - 'required_boolean_group': 'header', - 'required_int64_group': 'query', - 'string_group': 'query', - 'boolean_group': 'header', - 'int64_group': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client, - callable=__test_group_parameters - ) - - def __test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 - """test inline additionalProperties # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_inline_additional_properties(request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param {str: (str,)} request_body: request body (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['request_body'] = request_body - return self.call_with_http_info(**kwargs) - - self.test_inline_additional_properties = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/inline-additionalProperties', - 'operation_id': 'test_inline_additional_properties', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'request_body', - ], - 'required': [ - 'request_body', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'request_body': ({str: (str,)},), - }, - 'attribute_map': { - }, - 'location_map': { - 'request_body': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__test_inline_additional_properties - ) - - def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 - """test json serialization of form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_json_form_data(param, param2, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str param: field1 (required) - :param str param2: field2 (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['param'] = param - kwargs['param2'] = param2 - return self.call_with_http_info(**kwargs) - - self.test_json_form_data = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/jsonFormData', - 'operation_id': 'test_json_form_data', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'param', - 'param2', - ], - 'required': [ - 'param', - 'param2', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'param': (str,), - 'param2': (str,), - }, - 'attribute_map': { - 'param': 'param', - 'param2': 'param2', - }, - 'location_map': { - 'param': 'form', - 'param2': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client, - callable=__test_json_form_data - ) - - def __test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 - """test_query_parameter_collection_format # noqa: E501 - - To test the collection format in query parameters # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param [str] pipe: (required) - :param [str] ioutil: (required) - :param [str] http: (required) - :param [str] url: (required) - :param [str] context: (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pipe'] = pipe - kwargs['ioutil'] = ioutil - kwargs['http'] = http - kwargs['url'] = url - kwargs['context'] = context - return self.call_with_http_info(**kwargs) - - self.test_query_parameter_collection_format = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/fake/test-query-paramters', - 'operation_id': 'test_query_parameter_collection_format', - 'http_method': 'PUT', - 'servers': [], - }, - params_map={ - 'all': [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context', - ], - 'required': [ - 'pipe', - 'ioutil', - 'http', - 'url', - 'context', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pipe': ([str],), - 'ioutil': ([str],), - 'http': ([str],), - 'url': ([str],), - 'context': ([str],), - }, - 'attribute_map': { - 'pipe': 'pipe', - 'ioutil': 'ioutil', - 'http': 'http', - 'url': 'url', - 'context': 'context', - }, - 'location_map': { - 'pipe': 'query', - 'ioutil': 'query', - 'http': 'query', - 'url': 'query', - 'context': 'query', - }, - 'collection_format_map': { - 'pipe': 'multi', - 'ioutil': 'csv', - 'http': 'space', - 'url': 'csv', - 'context': 'multi', - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client, - callable=__test_query_parameter_collection_format - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (int,), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param] - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in six.iteritems(kwargs): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in six.iteritems(kwargs): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - pet_api = PetApi() - pet_api.add_pet # this is an instance of the class Endpoint - pet_api.add_pet() # this invokes pet_api.add_pet.__call__() - which then invokes the callable functions stored in that endpoint at - pet_api.add_pet.callable or self.callable in this class - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - _host = self.settings['servers'][kwargs['_host_index']] - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in six.iteritems(kwargs): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py deleted file mode 100644 index e4e38865cad5..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ /dev/null @@ -1,377 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError -) -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - int, - none_type, - str, - validate_and_convert_types -) -from petstore_api.models.client import Client - - -class FakeClassnameTags123Api(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __test_classname(self, client, **kwargs): # noqa: E501 - """To test class name in snake case # noqa: E501 - - To test class name in snake case # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_classname(client, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param Client client: client model (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: Client - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['client'] = client - return self.call_with_http_info(**kwargs) - - self.test_classname = Endpoint( - settings={ - 'response_type': (Client,), - 'auth': [ - 'api_key_query' - ], - 'endpoint_path': '/fake_classname_test', - 'operation_id': 'test_classname', - 'http_method': 'PATCH', - 'servers': [], - }, - params_map={ - 'all': [ - 'client', - ], - 'required': [ - 'client', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'client': (Client,), - }, - 'attribute_map': { - }, - 'location_map': { - 'client': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__test_classname - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (int,), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param] - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in six.iteritems(kwargs): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in six.iteritems(kwargs): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - pet_api = PetApi() - pet_api.add_pet # this is an instance of the class Endpoint - pet_api.add_pet() # this invokes pet_api.add_pet.__call__() - which then invokes the callable functions stored in that endpoint at - pet_api.add_pet.callable or self.callable in this class - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - _host = self.settings['servers'][kwargs['_host_index']] - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in six.iteritems(kwargs): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py deleted file mode 100644 index da5c4a261249..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ /dev/null @@ -1,1292 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError -) -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - int, - none_type, - str, - validate_and_convert_types -) -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.pet import Pet - - -class PetApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __add_pet(self, pet, **kwargs): # noqa: E501 - """Add a new pet to the store # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_pet(pet, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param Pet pet: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet'] = pet - return self.call_with_http_info(**kwargs) - - self.add_pet = Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet', - 'operation_id': 'add_pet', - 'http_method': 'POST', - 'servers': [ - 'http://petstore.swagger.io/v2', - 'http://path-server-test.petstore.local/v2' - ] - }, - params_map={ - 'all': [ - 'pet', - ], - 'required': [ - 'pet', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet': (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'pet': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client, - callable=__add_pet - ) - - def __delete_pet(self, pet_id, **kwargs): # noqa: E501 - """Deletes a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_pet(pet_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: Pet id to delete (required) - :param str api_key: - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id - return self.call_with_http_info(**kwargs) - - self.delete_pet = Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'delete_pet', - 'http_method': 'DELETE', - 'servers': [], - }, - params_map={ - 'all': [ - 'pet_id', - 'api_key', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': (int,), - 'api_key': (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'api_key': 'api_key', - }, - 'location_map': { - 'pet_id': 'path', - 'api_key': 'header', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client, - callable=__delete_pet - ) - - def __find_pets_by_status(self, status, **kwargs): # noqa: E501 - """Finds Pets by status # noqa: E501 - - Multiple status values can be provided with comma separated strings # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_pets_by_status(status, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param [str] status: Status values that need to be considered for filter (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['status'] = status - return self.call_with_http_info(**kwargs) - - self.find_pets_by_status = Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/findByStatus', - 'operation_id': 'find_pets_by_status', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'status', - ], - 'required': [ - 'status', - ], - 'nullable': [ - ], - 'enum': [ - 'status', - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - ('status',): { - - "AVAILABLE": "available", - "PENDING": "pending", - "SOLD": "sold" - }, - }, - 'openapi_types': { - 'status': ([str],), - }, - 'attribute_map': { - 'status': 'status', - }, - 'location_map': { - 'status': 'query', - }, - 'collection_format_map': { - 'status': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__find_pets_by_status - ) - - def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 - """Finds Pets by tags # noqa: E501 - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_pets_by_tags(tags, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param [str] tags: Tags to filter by (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: [Pet] - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['tags'] = tags - return self.call_with_http_info(**kwargs) - - self.find_pets_by_tags = Endpoint( - settings={ - 'response_type': ([Pet],), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/findByTags', - 'operation_id': 'find_pets_by_tags', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'tags', - ], - 'required': [ - 'tags', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'tags': ([str],), - }, - 'attribute_map': { - 'tags': 'tags', - }, - 'location_map': { - 'tags': 'query', - }, - 'collection_format_map': { - 'tags': 'csv', - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__find_pets_by_tags - ) - - def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 - """Find pet by ID # noqa: E501 - - Returns a single pet # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_pet_by_id(pet_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to return (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: Pet - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id - return self.call_with_http_info(**kwargs) - - self.get_pet_by_id = Endpoint( - settings={ - 'response_type': (Pet,), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'get_pet_by_id', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'pet_id', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': (int,), - }, - 'attribute_map': { - 'pet_id': 'petId', - }, - 'location_map': { - 'pet_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__get_pet_by_id - ) - - def __update_pet(self, pet, **kwargs): # noqa: E501 - """Update an existing pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet(pet, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param Pet pet: Pet object that needs to be added to the store (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet'] = pet - return self.call_with_http_info(**kwargs) - - self.update_pet = Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet', - 'operation_id': 'update_pet', - 'http_method': 'PUT', - 'servers': [ - 'http://petstore.swagger.io/v2', - 'http://path-server-test.petstore.local/v2' - ] - }, - params_map={ - 'all': [ - 'pet', - ], - 'required': [ - 'pet', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet': (Pet,), - }, - 'attribute_map': { - }, - 'location_map': { - 'pet': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json', - 'application/xml' - ] - }, - api_client=api_client, - callable=__update_pet - ) - - def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 - """Updates a pet in the store with form data # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet_with_form(pet_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet that needs to be updated (required) - :param str name: Updated name of the pet - :param str status: Updated status of the pet - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id - return self.call_with_http_info(**kwargs) - - self.update_pet_with_form = Endpoint( - settings={ - 'response_type': None, - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}', - 'operation_id': 'update_pet_with_form', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'pet_id', - 'name', - 'status', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': (int,), - 'name': (str,), - 'status': (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'name': 'name', - 'status': 'status', - }, - 'location_map': { - 'pet_id': 'path', - 'name': 'form', - 'status': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/x-www-form-urlencoded' - ] - }, - api_client=api_client, - callable=__update_pet_with_form - ) - - def __upload_file(self, pet_id, **kwargs): # noqa: E501 - """uploads an image # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_file(pet_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to update (required) - :param str additional_metadata: Additional data to pass to server - :param file_type file: file to upload - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id - return self.call_with_http_info(**kwargs) - - self.upload_file = Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/pet/{petId}/uploadImage', - 'operation_id': 'upload_file', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'pet_id', - 'additional_metadata', - 'file', - ], - 'required': [ - 'pet_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': (int,), - 'additional_metadata': (str,), - 'file': (file_type,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'additional_metadata': 'additionalMetadata', - 'file': 'file', - }, - 'location_map': { - 'pet_id': 'path', - 'additional_metadata': 'form', - 'file': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client, - callable=__upload_file - ) - - def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 - """uploads an image (required) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param int pet_id: ID of pet to update (required) - :param file_type required_file: file to upload (required) - :param str additional_metadata: Additional data to pass to server - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: ApiResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id - kwargs['required_file'] = required_file - return self.call_with_http_info(**kwargs) - - self.upload_file_with_required_file = Endpoint( - settings={ - 'response_type': (ApiResponse,), - 'auth': [ - 'petstore_auth' - ], - 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', - 'operation_id': 'upload_file_with_required_file', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'pet_id', - 'required_file', - 'additional_metadata', - ], - 'required': [ - 'pet_id', - 'required_file', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'pet_id': (int,), - 'required_file': (file_type,), - 'additional_metadata': (str,), - }, - 'attribute_map': { - 'pet_id': 'petId', - 'required_file': 'requiredFile', - 'additional_metadata': 'additionalMetadata', - }, - 'location_map': { - 'pet_id': 'path', - 'required_file': 'form', - 'additional_metadata': 'form', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'multipart/form-data' - ] - }, - api_client=api_client, - callable=__upload_file_with_required_file - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (int,), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param] - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in six.iteritems(kwargs): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in six.iteritems(kwargs): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - pet_api = PetApi() - pet_api.add_pet # this is an instance of the class Endpoint - pet_api.add_pet() # this invokes pet_api.add_pet.__call__() - which then invokes the callable functions stored in that endpoint at - pet_api.add_pet.callable or self.callable in this class - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - _host = self.settings['servers'][kwargs['_host_index']] - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in six.iteritems(kwargs): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py deleted file mode 100644 index ee9baec15d5e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py +++ /dev/null @@ -1,692 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError -) -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - int, - none_type, - str, - validate_and_convert_types -) -from petstore_api.models.order import Order - - -class StoreApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __delete_order(self, order_id, **kwargs): # noqa: E501 - """Delete purchase order by ID # noqa: E501 - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_order(order_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str order_id: ID of the order that needs to be deleted (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['order_id'] = order_id - return self.call_with_http_info(**kwargs) - - self.delete_order = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'delete_order', - 'http_method': 'DELETE', - 'servers': [], - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': (str,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client, - callable=__delete_order - ) - - def __get_inventory(self, **kwargs): # noqa: E501 - """Returns pet inventories by status # noqa: E501 - - Returns a map of status codes to quantities # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_inventory(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: {str: (int,)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.get_inventory = Endpoint( - settings={ - 'response_type': ({str: (int,)},), - 'auth': [ - 'api_key' - ], - 'endpoint_path': '/store/inventory', - 'operation_id': 'get_inventory', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__get_inventory - ) - - def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 - """Find purchase order by ID # noqa: E501 - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_order_by_id(order_id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param int order_id: ID of pet that needs to be fetched (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['order_id'] = order_id - return self.call_with_http_info(**kwargs) - - self.get_order_by_id = Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order/{order_id}', - 'operation_id': 'get_order_by_id', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'order_id', - ], - 'required': [ - 'order_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'order_id', - ] - }, - root_map={ - 'validations': { - ('order_id',): { - - 'inclusive_maximum': 5, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order_id': (int,), - }, - 'attribute_map': { - 'order_id': 'order_id', - }, - 'location_map': { - 'order_id': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__get_order_by_id - ) - - def __place_order(self, order, **kwargs): # noqa: E501 - """Place an order for a pet # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_order(order, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param Order order: order placed for purchasing the pet (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: Order - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['order'] = order - return self.call_with_http_info(**kwargs) - - self.place_order = Endpoint( - settings={ - 'response_type': (Order,), - 'auth': [], - 'endpoint_path': '/store/order', - 'operation_id': 'place_order', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'order', - ], - 'required': [ - 'order', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'order': (Order,), - }, - 'attribute_map': { - }, - 'location_map': { - 'order': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__place_order - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (int,), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param] - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in six.iteritems(kwargs): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in six.iteritems(kwargs): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - pet_api = PetApi() - pet_api.add_pet # this is an instance of the class Endpoint - pet_api.add_pet() # this invokes pet_api.add_pet.__call__() - which then invokes the callable functions stored in that endpoint at - pet_api.add_pet.callable or self.callable in this class - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - _host = self.settings['servers'][kwargs['_host_index']] - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in six.iteritems(kwargs): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py deleted file mode 100644 index 03b3226119df..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py +++ /dev/null @@ -1,1111 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from petstore_api.api_client import ApiClient -from petstore_api.exceptions import ( - ApiTypeError, - ApiValueError -) -from petstore_api.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - int, - none_type, - str, - validate_and_convert_types -) -from petstore_api.models.user import User - - -class UserApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __create_user(self, user, **kwargs): # noqa: E501 - """Create user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user(user, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param User user: Created user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['user'] = user - return self.call_with_http_info(**kwargs) - - self.create_user = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user', - 'operation_id': 'create_user', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'user', - ], - 'required': [ - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'user': (User,), - }, - 'attribute_map': { - }, - 'location_map': { - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__create_user - ) - - def __create_users_with_array_input(self, user, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_array_input(user, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param [User] user: List of user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['user'] = user - return self.call_with_http_info(**kwargs) - - self.create_users_with_array_input = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithArray', - 'operation_id': 'create_users_with_array_input', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'user', - ], - 'required': [ - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'user': ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__create_users_with_array_input - ) - - def __create_users_with_list_input(self, user, **kwargs): # noqa: E501 - """Creates list of users with given input array # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_list_input(user, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param [User] user: List of user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['user'] = user - return self.call_with_http_info(**kwargs) - - self.create_users_with_list_input = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/createWithList', - 'operation_id': 'create_users_with_list_input', - 'http_method': 'POST', - 'servers': [], - }, - params_map={ - 'all': [ - 'user', - ], - 'required': [ - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'user': ([User],), - }, - 'attribute_map': { - }, - 'location_map': { - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__create_users_with_list_input - ) - - def __delete_user(self, username, **kwargs): # noqa: E501 - """Delete user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user(username, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The name that needs to be deleted (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - return self.call_with_http_info(**kwargs) - - self.delete_user = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'delete_user', - 'http_method': 'DELETE', - 'servers': [], - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client, - callable=__delete_user - ) - - def __get_user_by_name(self, username, **kwargs): # noqa: E501 - """Get user by user name # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_user_by_name(username, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: User - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - return self.call_with_http_info(**kwargs) - - self.get_user_by_name = Endpoint( - settings={ - 'response_type': (User,), - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'get_user_by_name', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'username', - ], - 'required': [ - 'username', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': (str,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__get_user_by_name - ) - - def __login_user(self, username, password, **kwargs): # noqa: E501 - """Logs user into the system # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.login_user(username, password, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str username: The user name for login (required) - :param str password: The password for login in clear text (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: str - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - kwargs['password'] = password - return self.call_with_http_info(**kwargs) - - self.login_user = Endpoint( - settings={ - 'response_type': (str,), - 'auth': [], - 'endpoint_path': '/user/login', - 'operation_id': 'login_user', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - 'username', - 'password', - ], - 'required': [ - 'username', - 'password', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': (str,), - 'password': (str,), - }, - 'attribute_map': { - 'username': 'username', - 'password': 'password', - }, - 'location_map': { - 'username': 'query', - 'password': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/xml', - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client, - callable=__login_user - ) - - def __logout_user(self, **kwargs): # noqa: E501 - """Logs out current logged in user session # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.logout_user(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - return self.call_with_http_info(**kwargs) - - self.logout_user = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/logout', - 'operation_id': 'logout_user', - 'http_method': 'GET', - 'servers': [], - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [], - }, - api_client=api_client, - callable=__logout_user - ) - - def __update_user(self, username, user, **kwargs): # noqa: E501 - """Updated user # noqa: E501 - - This can only be done by the logged in user. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user(username, user, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - Default is False. - :param str username: name that need to be deleted (required) - :param User user: Updated user object (required) - :param _return_http_data_only: response data without head status - code and headers. Default is True. - :param _preload_content: if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - :param _check_input_type: boolean specifying if type checking - should be done one the data sent to the server. - Default is True. - :param _check_return_type: boolean specifying if type checking - should be done one the data received from the server. - Default is True. - :param _host_index: integer specifying the index of the server - that we want to use. - Default is 0. - :return: None - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - kwargs['user'] = user - return self.call_with_http_info(**kwargs) - - self.update_user = Endpoint( - settings={ - 'response_type': None, - 'auth': [], - 'endpoint_path': '/user/{username}', - 'operation_id': 'update_user', - 'http_method': 'PUT', - 'servers': [], - }, - params_map={ - 'all': [ - 'username', - 'user', - ], - 'required': [ - 'username', - 'user', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'username': (str,), - 'user': (User,), - }, - 'attribute_map': { - 'username': 'username', - }, - 'location_map': { - 'username': 'path', - 'user': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__update_user - ) - - -class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): - """Creates an endpoint - - Args: - settings (dict): see below key value pairs - 'response_type' (tuple/None): response type - 'auth' (list): a list of auth type keys - 'endpoint_path' (str): the endpoint path - 'operation_id' (str): endpoint string identifier - 'http_method' (str): POST/PUT/PATCH/GET etc - 'servers' (list): list of str servers that this endpoint is at - params_map (dict): see below key value pairs - 'all' (list): list of str endpoint parameter names - 'required' (list): list of required parameter names - 'nullable' (list): list of nullable parameter names - 'enum' (list): list of parameters with enum values - 'validation' (list): list of parameters with validations - root_map - 'validations' (dict): the dict mapping endpoint parameter tuple - paths to their validation dictionaries - 'allowed_values' (dict): the dict mapping endpoint parameter - tuple paths to their allowed_values (enum) dictionaries - 'openapi_types' (dict): param_name to openapi type - 'attribute_map' (dict): param_name to camelCase name - 'location_map' (dict): param_name to 'body', 'file', 'form', - 'header', 'path', 'query' - collection_format_map (dict): param_name to `csv` etc. - headers_map (dict): see below key value pairs - 'accept' (list): list of Accept header strings - 'content_type' (list): list of Content-Type header strings - api_client (ApiClient) api client instance - callable (function): the function which is invoked when the - Endpoint is called - """ - self.settings = settings - self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] - extra_types = { - 'async_req': (bool,), - '_host_index': (int,), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) - } - self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] - self.headers_map = headers_map - self.api_client = api_client - self.callable = callable - - def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: - if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) - - for param in self.params_map['validation']: - if param in kwargs: - check_validations( - self.validations, - (param,), - kwargs[param] - ) - - if kwargs['_check_input_type'] is False: - return - - for key, value in six.iteritems(kwargs): - fixed_val = validate_and_convert_types( - value, - self.openapi_types[key], - [key], - False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration - ) - kwargs[key] = fixed_val - - def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } - - for param_name, param_value in six.iteritems(kwargs): - param_location = self.location_map.get(param_name) - if param_location is None: - continue - if param_location: - if param_location == 'body': - params['body'] = param_value - continue - base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): - # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: - param_value_full = (base_name, param_value) - params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: - params[param_location][base_name] = param_value - collection_format = self.collection_format_map.get(param_name) - if collection_format: - params['collection_format'][base_name] = collection_format - - return params - - def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called - Example: - pet_api = PetApi() - pet_api.add_pet # this is an instance of the class Endpoint - pet_api.add_pet() # this invokes pet_api.add_pet.__call__() - which then invokes the callable functions stored in that endpoint at - pet_api.add_pet.callable or self.callable in this class - """ - return self.callable(self, *args, **kwargs) - - def call_with_http_info(self, **kwargs): - - try: - _host = self.settings['servers'][kwargs['_host_index']] - except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) - _host = None - - for key, value in six.iteritems(kwargs): - if key not in self.params_map['all']: - raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) - ) - # only throw this nullable ApiValueError if _check_input_type - # is False, if _check_input_type==True we catch this case - # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): - raise ApiValueError( - "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) - ) - - for key in self.params_map['required']: - if key not in kwargs.keys(): - raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) - ) - - self.__validate_inputs(kwargs) - - params = self.__gather_params(kwargs) - - accept_headers_list = self.headers_map['accept'] - if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) - - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list - - return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], - _host=_host, - collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py deleted file mode 100644 index 2fc2090d9488..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ /dev/null @@ -1,698 +0,0 @@ -# coding: utf-8 -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - -from __future__ import absolute_import - -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote, urlencode, urlparse -from Crypto.PublicKey import RSA, ECC -from Crypto.Signature import PKCS1_v1_5, pss, DSS -from Crypto.Hash import SHA256, SHA512 -from base64 import b64encode - -from petstore_api import rest -from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiValueError -from petstore_api.model_utils import ( - ModelNormal, - ModelSimple, - date, - datetime, - deserialize_file, - file_type, - model_to_dict, - str, - validate_and_convert_types -) - - -class ApiClient(object): - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. - """ - - # six.binary_type python2=str, python3=bytes - # six.text_type python2=unicode, python3=str - PRIMITIVE_TYPES = ( - (float, bool, six.binary_type, six.text_type) + six.integer_types - ) - _pool = None - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - self.pool_threads = pool_threads - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - - def __del__(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - self._pool = ThreadPool(self.pool_threads) - return self._pool - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - - self.last_response = response_data - - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime, date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - elif isinstance(obj, ModelNormal): - # Convert model obj to dict - # Convert attribute name to json key in - # model definition for request - obj_dict = model_to_dict(obj, serialize=True) - elif isinstance(obj, ModelSimple): - return self.sanitize_for_serialization(obj.value) - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type, _check_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param _check_type: boolean, whether to check the types of the data - received from the server - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == (file_type,): - content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) - - # fetch data from response object - try: - received_data = json.loads(response.data) - except ValueError: - received_data = response.data - - # store our data under the key of 'received_data' so users have some - # context if they are deserializing a string and the data type is wrong - deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration - ) - return deserialized_data - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _check_type=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response_type: For the response, a tuple containing: - valid classes - a list containing valid classes (for list schemas) - a dict containing a tuple of valid classes as the value - Example values: - (str,) - (Pet,) - (float, none_type) - ([int, none_type],) - ({str: (bool, str, int, float, date, datetime, str, none_type)},) - :param files dict: key -> field name, value -> a list of open file - objects for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _check_type: boolean describing if the data back from the server - should have its type checked. - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: None or a dict with key=param_name and - value is a list of open file objects - :return: List of tuples of form parameters with file data - """ - if files is None: - return [] - - params = [] - for param_name, file_instances in six.iteritems(files): - if file_instances is None: - # if the file field is nullable, skip None values - continue - for file_instance in file_instances: - if file_instance is None: - # if the file field is nullable, skip None values - continue - if file_instance.closed is True: - raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name - ) - filename = os.path.basename(file_instance.name) - filedata = file_instance.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) - file_instance.close() - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :resource_path: The HTTP request resource path. - :method: The HTTP request method. - :body: The body of the HTTP request. - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if auth_setting['type'] == 'http-signature': - # The HTTP signature scheme requires multiple HTTP headers that are calculated dynamically. - auth_headers = self.get_http_signature_headers(resource_path, method, headers, body, querys) - for key, value in auth_headers.items(): - headers[key] = value - continue - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def get_http_signature_headers(self, resource_path, method, headers, body, query_params): - """ - Create a message signature for the HTTP request and add the signed headers. - - :param resource_path : resource path which is the api being called upon. - :param method: the HTTP request method. - :param headers: the request headers. - :param body: body passed in the http request. - :param query_params: query parameters used by the API - :return: instance of digest object - """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - if body is None: - body = '' - else: - body = json.dumps(body) - - target_host = urlparse(self.configuration.host).netloc - target_path = urlparse(self.configuration.host).path - - request_target = method.lower() + " " + target_path + resource_path - - if query_params: - raw_query = urlencode(query_params).replace('+', '%20') - request_target += "?" + raw_query - - from email.utils import formatdate - cdate=formatdate(timeval=None, localtime=False, usegmt=True) - - request_body = body.encode() - body_digest, digest_prefix = self.get_message_digest(request_body) - b64_body_digest = b64encode(body_digest.digest()) - - signed_headers = { - 'Date': cdate, - 'Host': target_host, - 'Digest': digest_prefix + b64_body_digest.decode('ascii') - } - for hdr_key in self.configuration.signed_headers: - signed_headers[hdr_key] = headers[hdr_key] - - string_to_sign = self.get_str_to_sign(request_target, signed_headers) - - digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) - b64_signed_msg = self.sign_digest(digest) - - auth_header = self.get_authorization_header(signed_headers, b64_signed_msg) - - return { - 'Date': '{0}'.format(cdate), - 'Host': '{0}'.format(target_host), - 'Digest': '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')), - 'Authorization': '{0}'.format(auth_header) - } - - def get_message_digest(self, data): - """ - Calculates and returns a cryptographic digest of a specified HTTP request. - - :param data: The message to be hashed with a cryptographic hash. - :return: The message digest encoded as a byte string. - """ - if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: - digest = SHA512.new() - prefix = "SHA-512=" - elif self.configuration.signing_scheme in ["rsa-sha256"]: - digest = SHA256.new() - prefix = "SHA-256=" - else: - raise Exception("Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) - digest.update(data) - return digest, prefix - - def sign_digest(self, digest): - """ - Signs a message digest with a private key specified in the configuration. - - :param digest: digest of the HTTP message. - :return: the HTTP message signature encoded as a byte string. - """ - self.configuration.load_private_key() - privkey = self.configuration.private_key - if isinstance(privkey, RSA.RsaKey): - if self.configuration.signing_algorithm == 'PSS': - # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(privkey).sign(digest) - elif self.configuration.signing_algorithm == 'PKCS1-v1_5': - # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(privkey).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) - elif isinstance(privkey, ECC.EccKey): - if self.configuration.signing_algorithm in ['fips-186-3', 'deterministic-rfc6979']: - signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) - else: - raise Exception("Unsupported private key: {0}".format(type(privkey))) - return b64encode(signature) - - def get_str_to_sign(self, req_tgt, hdrs): - """ - Generate and return a string value representing the HTTP request to be signed. - - :param req_tgt : Request Target as stored in http header. - :param hdrs: HTTP Headers to be signed. - :return: instance of digest object - """ - ss = "" - ss = ss + "(request-target): " + req_tgt + "\n" - - length = len(hdrs.items()) - - i = 0 - for key, value in hdrs.items(): - ss = ss + key.lower() + ": " + value - if i < length-1: - ss = ss + "\n" - i += 1 - - return ss - - def get_authorization_header(self, hdrs, signed_msg): - """ - Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param hdrs : The list of signed HTTP Headers - :param signed_msg: Signed Digest - :return: instance of digest object - """ - - auth_str = "" - auth_str = auth_str + "Signature" - - auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" - - for key, _ in hdrs.items(): - auth_str = auth_str + " " + key.lower() - auth_str = auth_str + "\"" - - auth_str = auth_str + "," + "signature=\"" + signed_msg.decode('ascii') + "\"" - - return auth_str - diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py deleted file mode 100644 index 5b100fcff6c8..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ /dev/null @@ -1,436 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import logging -import multiprocessing -import pem -from Crypto.PublicKey import RSA, ECC -import sys -import urllib3 - -import six -from six.moves import http_client as httplib - - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s) - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests - :param private_key_path: The path of the file containing a private key, when signing HTTP requests - :param signing_scheme: The signature scheme, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 - :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 - :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests - """ - - def __init__(self, host="http://petstore.swagger.io:80/v2", - api_key=None, api_key_prefix=None, - username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): - """Constructor - """ - self.host = host - """Default Base url - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests. - """ - self.access_token = "" - """access token for OAuth/Bearer - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("petstore_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = None - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - self.private_key = None - """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Disable client side validation - self.client_side_validation = True - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - return urllib3.util.make_headers( - basic_auth=self.username + ':' + self.password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - return { - 'api_key': - { - 'type': 'api_key', - 'in': 'header', - 'key': 'api_key', - 'value': self.get_api_key_with_prefix('api_key') - }, - 'api_key_query': - { - 'type': 'api_key', - 'in': 'query', - 'key': 'api_key_query', - 'value': self.get_api_key_with_prefix('api_key_query') - }, - 'bearer_test': - { - 'type': 'bearer', - 'in': 'header', - 'format': 'JWT', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - }, - 'http_basic_test': - { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - }, - 'http_signature_test': - { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - }, - 'petstore_auth': - { - 'type': 'oauth2', - 'in': 'header', - 'key': 'Authorization', - 'value': 'Bearer ' + self.access_token - }, - } - - def load_private_key(self): - """Load the private key used to sign HTTP requests. - """ - if self.private_key is not None: - return - with open(self.private_key_path, "rb") as f: - # Decode PEM file and determine key type from PEM header. - # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". - keys = pem.parse(f.read()) - if len(keys) != 1: - raise Exception("File must contain exactly one private key") - key = keys[0].as_text() - if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): - self.private_key = RSA.importKey(key) - elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): - self.private_key = ECC.importKey(key) - else: - raise Exception("Unsupported key") - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "http://{server}.swagger.io:{port}/v2", - 'description': "petstore server", - 'variables': { - 'server': { - 'description': "No description provided", - 'default_value': "petstore", - 'enum_values': [ - "petstore", - "qa-petstore", - "dev-petstore" - ] - }, - 'port': { - 'description': "No description provided", - 'default_value': "80", - 'enum_values': [ - "80", - "8080" - ] - } - } - }, - { - 'url': "https://localhost:8080/{version}", - 'description': "The local server", - 'variables': { - 'version': { - 'description': "No description provided", - 'default_value': "v2", - 'enum_values': [ - "v1", - "v2" - ] - } - } - } - ] - - def get_host_from_settings(self, index, variables={}): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :return: URL based on host settings - """ - - servers = self.get_host_settings() - - # check array index out of bound - if index < 0 or index >= len(servers): - raise ValueError( - "Invalid index {} when selecting the host settings. Must be less than {}" # noqa: E501 - .format(index, len(servers))) - - server = servers[index] - url = server['url'] - - # go through variable and assign a value - for variable_name in server['variables']: - if variable_name in variables: - if variables[variable_name] in server['variables'][ - variable_name]['enum_values']: - url = url.replace("{" + variable_name + "}", - variables[variable_name]) - else: - raise ValueError( - "The variable `{}` in the host URL has invalid value {}. Must be {}." # noqa: E501 - .format( - variable_name, variables[variable_name], - server['variables'][variable_name]['enum_values'])) - else: - # use default value - url = url.replace( - "{" + variable_name + "}", - server['variables'][variable_name]['default_value']) - - return url diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py deleted file mode 100644 index 100be3e0540f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import six - - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, six.integer_types): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py deleted file mode 100644 index 22d9ee459de7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ /dev/null @@ -1,876 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import copy -from datetime import date, datetime # noqa: F401 -import inspect -import os -import re -import tempfile - -from dateutil.parser import parse -import six - -from petstore_api.exceptions import ( - ApiKeyError, - ApiTypeError, - ApiValueError, -) - -none_type = type(None) -if six.PY3: - import io - file_type = io.IOBase - # these are needed for when other modules import str and int from here - str = str - int = int -else: - file_type = file # noqa: F821 - str_py2 = str - unicode_py2 = unicode # noqa: F821 - long_py2 = long # noqa: F821 - int_py2 = int - # this requires that the future library is installed - from builtins import int, str - - -class OpenApiModel(object): - """The base class for all OpenAPIModels""" - - -class ModelSimple(OpenApiModel): - """the parent class of models whose type != object in their - swagger/openapi""" - - -class ModelNormal(OpenApiModel): - """the parent class of models whose type == object in their - swagger/openapi""" - - -COERCION_INDEX_BY_TYPE = { - ModelNormal: 0, - ModelSimple: 1, - none_type: 2, - list: 3, - dict: 4, - float: 5, - int: 6, - bool: 7, - datetime: 8, - date: 9, - str: 10, - file_type: 11, -} - -# these are used to limit what type conversions we try to do -# when we have a valid type already and we want to try converting -# to another type -UPCONVERSION_TYPE_PAIRS = ( - (str, datetime), - (str, date), - (list, ModelNormal), - (dict, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), -) - -COERCIBLE_TYPE_PAIRS = { - False: ( # client instantiation of a model with client data - # (dict, ModelNormal), - # (list, ModelNormal), - # (str, ModelSimple), - # (int, ModelSimple), - # (float, ModelSimple), - # (list, ModelSimple), - # (str, int), - # (str, float), - # (str, datetime), - # (str, date), - # (int, str), - # (float, str), - ), - True: ( # server -> client data - (dict, ModelNormal), - (list, ModelNormal), - (str, ModelSimple), - (int, ModelSimple), - (float, ModelSimple), - (list, ModelSimple), - # (str, int), - # (str, float), - (str, datetime), - (str, date), - # (int, str), - # (float, str), - (str, file_type) - ), -} - - -def get_simple_class(input_value): - """Returns an input_value's simple class that we will use for type checking - Python2: - float and int will return int, where int is the python3 int backport - str and unicode will return str, where str is the python3 str backport - Note: float and int ARE both instances of int backport - Note: str_py2 and unicode_py2 are NOT both instances of str backport - - Args: - input_value (class/class_instance): the item for which we will return - the simple class - """ - if isinstance(input_value, type): - # input_value is a class - return input_value - elif isinstance(input_value, tuple): - return tuple - elif isinstance(input_value, list): - return list - elif isinstance(input_value, dict): - return dict - elif isinstance(input_value, none_type): - return none_type - elif isinstance(input_value, file_type): - return file_type - elif isinstance(input_value, bool): - # this must be higher than the int check because - # isinstance(True, int) == True - return bool - elif isinstance(input_value, int): - # for python2 input_value==long_instance -> return int - # where int is the python3 int backport - return int - elif isinstance(input_value, datetime): - # this must be higher than the date check because - # isinstance(datetime_instance, date) == True - return datetime - elif isinstance(input_value, date): - return date - elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or - isinstance(input_value, str)): - return str - return type(input_value) - - -def check_allowed_values(allowed_values, input_variable_path, input_values): - """Raises an exception if the input_values are not allowed - - Args: - allowed_values (dict): the allowed_values dict - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking to see if they are in allowed_values - """ - these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), - raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) - raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) - ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): - raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) - ) - - -def check_validations(validations, input_variable_path, input_values): - """Raises an exception if the input_values are invalid - - Args: - validations (dict): the validation dictionary - input_variable_path (tuple): the path to the input variable - input_values (list/str/int/float/date/datetime): the values that we - are checking - """ - current_validations = validations[input_variable_path] - if ('max_length' in current_validations and - len(input_values) > current_validations['max_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) - ) - - if ('min_length' in current_validations and - len(input_values) < current_validations['min_length']): - raise ApiValueError( - "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) - ) - - if ('max_items' in current_validations and - len(input_values) > current_validations['max_items']): - raise ApiValueError( - "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) - ) - - if ('min_items' in current_validations and - len(input_values) < current_validations['min_items']): - raise ValueError( - "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) - ) - - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): - if isinstance(input_values, list): - max_val = max(input_values) - min_val = min(input_values) - elif isinstance(input_values, dict): - max_val = max(input_values.values()) - min_val = min(input_values.values()) - else: - max_val = input_values - min_val = input_values - - if ('exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if ('inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) - ) - - if ('exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) - ) - - if ('inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): - raise ApiValueError( - "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) - ) - flags = current_validations.get('regex', {}).get('flags', 0) - if ('regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): - raise ApiValueError( - r"Invalid value for `%s`, must be a follow pattern or equal to " - r"`%s` with flags=`%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'], - flags - ) - ) - - -def order_response_types(required_types): - """Returns the required types sorted in coercion order - - Args: - required_types (list/tuple): collection of classes or instance of - list or dict with classs information inside it - - Returns: - (list): coercion order sorted collection of classes or instance - of list or dict with classs information inside it - """ - - def index_getter(class_or_instance): - if isinstance(class_or_instance, list): - return COERCION_INDEX_BY_TYPE[list] - elif isinstance(class_or_instance, dict): - return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): - return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): - return COERCION_INDEX_BY_TYPE[ModelSimple] - return COERCION_INDEX_BY_TYPE[class_or_instance] - - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) - return sorted_types - - -def remove_uncoercible(required_types_classes, current_item, from_server, - must_convert=True): - """Only keeps the type conversions that are possible - - Args: - required_types_classes (tuple): tuple of classes that are required - these should be ordered by COERCION_INDEX_BY_TYPE - from_server (bool): a boolean of whether the data is from the server - if false, the data is from the client - current_item (any): the current item to be converted - - Keyword Args: - must_convert (bool): if True the item to convert is of the wrong - type and we want a big list of coercibles - if False, we want a limited list of coercibles - - Returns: - (list): the remaining coercible required types, classes only - """ - current_type_simple = get_simple_class(current_item) - - results_classes = [] - for required_type_class in required_types_classes: - # convert our models to OpenApiModel - required_type_class_simplified = required_type_class - if isinstance(required_type_class_simplified, type): - if issubclass(required_type_class_simplified, ModelNormal): - required_type_class_simplified = ModelNormal - elif issubclass(required_type_class_simplified, ModelSimple): - required_type_class_simplified = ModelSimple - - if required_type_class_simplified == current_type_simple: - # don't consider converting to one's own class - continue - - class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: - results_classes.append(required_type_class) - elif class_pair in UPCONVERSION_TYPE_PAIRS: - results_classes.append(required_type_class) - return results_classes - - -def get_required_type_classes(required_types_mixed): - """Converts the tuple required_types into a tuple and a dict described - below - - Args: - required_types_mixed (tuple/list): will contain either classes or - instance of list or dict - - Returns: - (valid_classes, dict_valid_class_to_child_types_mixed): - valid_classes (tuple): the valid classes that the current item - should be - dict_valid_class_to_child_types_mixed (doct): - valid_class (class): this is the key - child_types_mixed (list/dict/tuple): describes the valid child - types - """ - valid_classes = [] - child_req_types_by_current_type = {} - for required_type in required_types_mixed: - if isinstance(required_type, list): - valid_classes.append(list) - child_req_types_by_current_type[list] = required_type - elif isinstance(required_type, tuple): - valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type - elif isinstance(required_type, dict): - valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] - else: - valid_classes.append(required_type) - return tuple(valid_classes), child_req_types_by_current_type - - -def change_keys_js_to_python(input_dict, model_class): - """ - Converts from javascript_key keys in the input_dict to python_keys in - the output dict using the mapping in model_class - """ - - output_dict = {} - reversed_attr_map = {value: key for key, value in - six.iteritems(model_class.attribute_map)} - for javascript_key, value in six.iteritems(input_dict): - python_key = reversed_attr_map.get(javascript_key) - if python_key is None: - # if the key is unknown, it is in error or it is an - # additionalProperties variable - python_key = javascript_key - output_dict[python_key] = value - return output_dict - - -def get_type_error(var_value, path_to_item, valid_classes, key_type=False): - error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type - ) - - -def deserialize_primitive(data, klass, path_to_item): - """Deserializes string to primitive type. - - :param data: str/int/float - :param klass: str/class the class to convert to - - :return: int, float, str, bool, date, datetime - """ - additional_message = "" - try: - if klass in {datetime, date}: - additional_message = ( - "If you need your parameter to have a fallback " - "string value, please set its type as `type: {}` in your " - "spec. That allows the value to be any type. " - ) - if klass == datetime: - if len(data) < 8: - raise ValueError("This is not a datetime") - # The string should be in iso8601 datetime format. - parsed_datetime = parse(data) - date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 - ) - if date_only: - raise ValueError("This is a date, not a datetime") - return parsed_datetime - elif klass == date: - if len(data) < 8: - raise ValueError("This is not a date") - return parse(data).date() - else: - converted_value = klass(data) - if isinstance(data, str) and klass == float: - if str(converted_value) != data: - # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') - return converted_value - except (OverflowError, ValueError): - # parse can raise OverflowError - raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), get_py3_class_name(klass) - ), - path_to_item=path_to_item - ) - - -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, from_server): - """Deserializes model_data to model instance. - - Args: - model_data (list/dict): data to instantiate the model - model_class (OpenApiModel): the model class - path_to_item (list): path to the model in the received data - check_type (bool): whether to check the data tupe for the values in - the model - configuration (Configuration): the instance to use to convert files - from_server (bool): True if the data is from the server - False if the data is from the client - - Returns: - model instance - - Raise: - ApiTypeError - ApiValueError - ApiKeyError - """ - fixed_model_data = copy.deepcopy(model_data) - - if isinstance(fixed_model_data, dict): - fixed_model_data = change_keys_js_to_python(fixed_model_data, - model_class) - - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _from_server=from_server) - - if hasattr(model_class, 'get_real_child_model'): - # discriminator case - discriminator_class = model_class.get_real_child_model(model_data) - if discriminator_class: - if isinstance(model_data, list): - instance = discriminator_class(*model_data, **kw_args) - elif isinstance(model_data, dict): - fixed_model_data = change_keys_js_to_python( - fixed_model_data, - discriminator_class - ) - kw_args.update(fixed_model_data) - instance = discriminator_class(**kw_args) - else: - # all other cases - if isinstance(model_data, list): - instance = model_class(*model_data, **kw_args) - if isinstance(model_data, dict): - fixed_model_data = change_keys_js_to_python(fixed_model_data, - model_class) - kw_args.update(fixed_model_data) - instance = model_class(**kw_args) - else: - instance = model_class(model_data, **kw_args) - - return instance - - -def deserialize_file(response_data, configuration, content_disposition=None): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - Args: - param response_data (str): the file data to write - configuration (Configuration): the instance to use to convert files - - Keyword Args: - content_disposition (str): the value of the Content-Disposition - header - - Returns: - (file_type): the deserialized file which is open - The user is responsible for closing and reading the file - """ - fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - if six.PY3 and isinstance(response_data, str): - # in python3 change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - - f = open(path, "rb") - return f - - -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, from_server, key_type=False, - must_convert=False, check_type=True): - """ - Args: - input_value (any): the data to convert - valid_classes (any): the classes that are valid - path_to_item (list): the path to the item to convert - configuration (Configuration): the instance to use to convert files - from_server (bool): True if data is from the server, False is data is - from the client - key_type (bool): if True we need to convert a key type (not supported) - must_convert (bool): if True we must convert - check_type (bool): if True we check the type or the returned data in - ModelNormal and ModelSimple instances - - Returns: - instance (any) the fixed item - - Raises: - ApiTypeError - ApiValueError - ApiKeyError - """ - valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, from_server) - if not valid_classes_coercible or key_type: - # we do not handle keytype errors, json will take care - # of this for us - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) - for valid_class in valid_classes_coercible: - try: - if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, from_server) - elif valid_class == file_type: - return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) - except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: - if must_convert: - raise conversion_exc - # if we have conversion errors when must_convert == False - # we ignore the exception and move on to the next class - continue - # we were unable to convert, must_convert == False - return input_value - - -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - from_server, _check_type, configuration=None): - """Raises a TypeError is there is a problem, otherwise returns value - - Args: - input_value (any): the data to validate/convert - required_types_mixed (list/dict/tuple): A list of - valid classes, or a list tuples of valid classes, or a dict where - the value is a tuple of value classes - path_to_item: (list) the path to the data being validated - this stores a list of keys or indices to get to the data being - validated - from_server (bool): True if data is from the server - False if data is from the client - _check_type: (boolean) if true, type will be checked and conversion - will be attempted. - configuration: (Configuration): the configuration class to use - when converting file_type items. - If passed, conversion will be attempted when possible - If not passed, no conversions will be attempted and - exceptions will be raised - - Returns: - the correctly typed value - - Raises: - ApiTypeError - """ - results = get_required_type_classes(required_types_mixed) - valid_classes, child_req_types_by_current_type = results - - input_class_simple = get_simple_class(input_value) - valid_type = input_class_simple in set(valid_classes) - if not valid_type: - if configuration: - # if input_value is not valid_type try to convert it - converted_instance = attempt_convert_item( - input_value, - valid_classes, - path_to_item, - configuration, - from_server, - key_type=False, - must_convert=True - ) - return converted_instance - else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) - - # input_value's type is in valid_classes - if len(valid_classes) > 1 and configuration: - # there are valid classes which are not the current class - valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, from_server, must_convert=False) - if valid_classes_coercible: - converted_instance = attempt_convert_item( - input_value, - valid_classes_coercible, - path_to_item, - configuration, - from_server, - key_type=False, - must_convert=False - ) - return converted_instance - - if child_req_types_by_current_type == {}: - # all types are of the required types and there are no more inner - # variables left to look at - return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) - if inner_required_types is None: - # for this type, there are not more inner variables left to look at - return input_value - if isinstance(input_value, list): - if input_value == []: - # allow an empty list - return input_value - for index, inner_value in enumerate(input_value): - inner_path = list(path_to_item) - inner_path.append(index) - input_value[index] = validate_and_convert_types( - inner_value, - inner_required_types, - inner_path, - from_server, - _check_type, - configuration=configuration - ) - elif isinstance(input_value, dict): - if input_value == {}: - # allow an empty dict - return input_value - for inner_key, inner_val in six.iteritems(input_value): - inner_path = list(path_to_item) - inner_path.append(inner_key) - if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) - input_value[inner_key] = validate_and_convert_types( - inner_val, - inner_required_types, - inner_path, - from_server, - _check_type, - configuration=configuration - ) - return input_value - - -def model_to_dict(model_instance, serialize=True): - """Returns the model properties as a dict - - Args: - model_instance (one of your model instances): the model instance that - will be converted to a dict. - - Keyword Args: - serialize (bool): if True, the keys in the dict will be values from - attribute_map - """ - result = {} - - for attr, value in six.iteritems(model_instance._data_store): - if serialize: - # we use get here because additional property key names do not - # exist in attribute_map - attr = model_instance.attribute_map.get(attr, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: model_to_dict(x, serialize=serialize) - if hasattr(x, '_data_store') else x, value - )) - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, - value.items() - )) - elif hasattr(value, '_data_store'): - result[attr] = model_to_dict(value, serialize=serialize) - else: - result[attr] = value - - return result - - -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): - """ - Keyword Args: - var_value (any): the variable which has the type_error - var_name (str): the name of the variable which has the typ error - valid_classes (tuple): the accepted classes for current_item's - value - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - """ - key_or_value = 'value' - if key_type: - key_or_value = 'key' - valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) - ) - return msg - - -def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - Note: Adds the extra valid classes in python2 - """ - all_classes = list(input_classes) - if six.PY2 and str in input_classes: - all_classes.extend([str_py2, unicode_py2]) - if six.PY2 and int in input_classes: - all_classes.extend([int_py2, long_py2]) - all_classes = sorted(all_classes, key=lambda cls: cls.__name__) - all_class_names = [cls.__name__ for cls in all_classes] - if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) - return "is one of [{0}]".format(", ".join(all_class_names)) - - -def get_py3_class_name(input_class): - if six.PY2: - if input_class == str: - return 'str' - elif input_class == int: - return 'int' - return input_class.__name__ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py deleted file mode 100644 index 055355937d8e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -# import models into model package -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass -from petstore_api.models.animal import Animal -from petstore_api.models.api_response import ApiResponse -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly -from petstore_api.models.array_test import ArrayTest -from petstore_api.models.capitalization import Capitalization -from petstore_api.models.cat import Cat -from petstore_api.models.cat_all_of import CatAllOf -from petstore_api.models.category import Category -from petstore_api.models.class_model import ClassModel -from petstore_api.models.client import Client -from petstore_api.models.dog import Dog -from petstore_api.models.dog_all_of import DogAllOf -from petstore_api.models.enum_arrays import EnumArrays -from petstore_api.models.enum_class import EnumClass -from petstore_api.models.enum_test import EnumTest -from petstore_api.models.file import File -from petstore_api.models.file_schema_test_class import FileSchemaTestClass -from petstore_api.models.foo import Foo -from petstore_api.models.format_test import FormatTest -from petstore_api.models.has_only_read_only import HasOnlyReadOnly -from petstore_api.models.health_check_result import HealthCheckResult -from petstore_api.models.inline_object import InlineObject -from petstore_api.models.inline_object1 import InlineObject1 -from petstore_api.models.inline_object2 import InlineObject2 -from petstore_api.models.inline_object3 import InlineObject3 -from petstore_api.models.inline_object4 import InlineObject4 -from petstore_api.models.inline_object5 import InlineObject5 -from petstore_api.models.inline_response_default import InlineResponseDefault -from petstore_api.models.list import List -from petstore_api.models.map_test import MapTest -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass -from petstore_api.models.model200_response import Model200Response -from petstore_api.models.model_return import ModelReturn -from petstore_api.models.name import Name -from petstore_api.models.nullable_class import NullableClass -from petstore_api.models.number_only import NumberOnly -from petstore_api.models.order import Order -from petstore_api.models.outer_composite import OuterComposite -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue -from petstore_api.models.outer_enum_integer import OuterEnumInteger -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue -from petstore_api.models.pet import Pet -from petstore_api.models.read_only_first import ReadOnlyFirst -from petstore_api.models.special_model_name import SpecialModelName -from petstore_api.models.string_boolean_map import StringBooleanMap -from petstore_api.models.tag import Tag -from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py deleted file mode 100644 index 980a953b8f83..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py +++ /dev/null @@ -1,252 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class AdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'map_property': 'map_property', # noqa: E501 - 'map_of_map_property': 'map_of_map_property' # noqa: E501 - } - - openapi_types = { - 'map_property': ({str: (str,)},), # noqa: E501 - 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """AdditionalPropertiesClass - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - map_property ({str: (str,)}): [optional] # noqa: E501 - map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def map_property(self): - """Gets the map_property of this AdditionalPropertiesClass. # noqa: E501 - - Returns: - ({str: (str,)}): The map_property of this AdditionalPropertiesClass. # noqa: E501 - """ - return self.__get_item('map_property') - - @map_property.setter - def map_property(self, value): - """Sets the map_property of this AdditionalPropertiesClass. # noqa: E501 - """ - return self.__set_item('map_property', value) - - @property - def map_of_map_property(self): - """Gets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - - Returns: - ({str: ({str: (str,)},)}): The map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - """ - return self.__get_item('map_of_map_property') - - @map_of_map_property.setter - def map_of_map_property(self, value): - """Sets the map_of_map_property of this AdditionalPropertiesClass. # noqa: E501 - """ - return self.__set_item('map_of_map_property', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, AdditionalPropertiesClass): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py deleted file mode 100644 index d625389dd634..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py +++ /dev/null @@ -1,270 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog - - -class Animal(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'color': 'color' # noqa: E501 - } - - discriminator_value_class_map = { - 'Dog': Dog, - 'Cat': Cat - } - - openapi_types = { - 'class_name': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = 'class_name' - - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Animal - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('class_name', class_name) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def class_name(self): - """Gets the class_name of this Animal. # noqa: E501 - - Returns: - (str): The class_name of this Animal. # noqa: E501 - """ - return self.__get_item('class_name') - - @class_name.setter - def class_name(self, value): - """Sets the class_name of this Animal. # noqa: E501 - """ - return self.__set_item('class_name', value) - - @property - def color(self): - """Gets the color of this Animal. # noqa: E501 - - Returns: - (str): The color of this Animal. # noqa: E501 - """ - return self.__get_item('color') - - @color.setter - def color(self, value): - """Sets the color of this Animal. # noqa: E501 - """ - return self.__set_item('color', value) - - @classmethod - def get_real_child_model(cls, data): - """Returns the real base class specified by the discriminator - We assume that data has javascript keys - """ - discriminator_key = cls.attribute_map[cls.discriminator] - discriminator_value = data[discriminator_key] - return cls.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Animal): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py deleted file mode 100644 index 40713b75479a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py +++ /dev/null @@ -1,270 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class ApiResponse(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'code': 'code', # noqa: E501 - 'type': 'type', # noqa: E501 - 'message': 'message' # noqa: E501 - } - - openapi_types = { - 'code': (int,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """ApiResponse - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - code (int): [optional] # noqa: E501 - type (str): [optional] # noqa: E501 - message (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def code(self): - """Gets the code of this ApiResponse. # noqa: E501 - - Returns: - (int): The code of this ApiResponse. # noqa: E501 - """ - return self.__get_item('code') - - @code.setter - def code(self, value): - """Sets the code of this ApiResponse. # noqa: E501 - """ - return self.__set_item('code', value) - - @property - def type(self): - """Gets the type of this ApiResponse. # noqa: E501 - - Returns: - (str): The type of this ApiResponse. # noqa: E501 - """ - return self.__get_item('type') - - @type.setter - def type(self, value): - """Sets the type of this ApiResponse. # noqa: E501 - """ - return self.__set_item('type', value) - - @property - def message(self): - """Gets the message of this ApiResponse. # noqa: E501 - - Returns: - (str): The message of this ApiResponse. # noqa: E501 - """ - return self.__get_item('message') - - @message.setter - def message(self, value): - """Sets the message of this ApiResponse. # noqa: E501 - """ - return self.__set_item('message', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ApiResponse): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py deleted file mode 100644 index a2e3c7326a68..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class ArrayOfArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'array_array_number': 'ArrayArrayNumber' # noqa: E501 - } - - openapi_types = { - 'array_array_number': ([[float]],), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - array_array_number ([[float]]): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def array_array_number(self): - """Gets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - - Returns: - ([[float]]): The array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - """ - return self.__get_item('array_array_number') - - @array_array_number.setter - def array_array_number(self, value): - """Sets the array_array_number of this ArrayOfArrayOfNumberOnly. # noqa: E501 - """ - return self.__set_item('array_array_number', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfArrayOfNumberOnly): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py deleted file mode 100644 index c35c8e59631c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class ArrayOfNumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'array_number': 'ArrayNumber' # noqa: E501 - } - - openapi_types = { - 'array_number': ([float],), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """ArrayOfNumberOnly - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - array_number ([float]): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def array_number(self): - """Gets the array_number of this ArrayOfNumberOnly. # noqa: E501 - - Returns: - ([float]): The array_number of this ArrayOfNumberOnly. # noqa: E501 - """ - return self.__get_item('array_number') - - @array_number.setter - def array_number(self, value): - """Sets the array_number of this ArrayOfNumberOnly. # noqa: E501 - """ - return self.__set_item('array_number', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayOfNumberOnly): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py deleted file mode 100644 index cc52f04d318f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.read_only_first import ReadOnlyFirst - - -class ArrayTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'array_of_string': 'array_of_string', # noqa: E501 - 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 - 'array_array_of_model': 'array_array_of_model' # noqa: E501 - } - - openapi_types = { - 'array_of_string': ([str],), # noqa: E501 - 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """ArrayTest - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - array_of_string ([str]): [optional] # noqa: E501 - array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def array_of_string(self): - """Gets the array_of_string of this ArrayTest. # noqa: E501 - - Returns: - ([str]): The array_of_string of this ArrayTest. # noqa: E501 - """ - return self.__get_item('array_of_string') - - @array_of_string.setter - def array_of_string(self, value): - """Sets the array_of_string of this ArrayTest. # noqa: E501 - """ - return self.__set_item('array_of_string', value) - - @property - def array_array_of_integer(self): - """Gets the array_array_of_integer of this ArrayTest. # noqa: E501 - - Returns: - ([[int]]): The array_array_of_integer of this ArrayTest. # noqa: E501 - """ - return self.__get_item('array_array_of_integer') - - @array_array_of_integer.setter - def array_array_of_integer(self, value): - """Sets the array_array_of_integer of this ArrayTest. # noqa: E501 - """ - return self.__set_item('array_array_of_integer', value) - - @property - def array_array_of_model(self): - """Gets the array_array_of_model of this ArrayTest. # noqa: E501 - - Returns: - ([[ReadOnlyFirst]]): The array_array_of_model of this ArrayTest. # noqa: E501 - """ - return self.__get_item('array_array_of_model') - - @array_array_of_model.setter - def array_array_of_model(self, value): - """Sets the array_array_of_model of this ArrayTest. # noqa: E501 - """ - return self.__set_item('array_array_of_model', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ArrayTest): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py deleted file mode 100644 index 9134f5e4251f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py +++ /dev/null @@ -1,326 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Capitalization(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'small_camel': 'smallCamel', # noqa: E501 - 'capital_camel': 'CapitalCamel', # noqa: E501 - 'small_snake': 'small_Snake', # noqa: E501 - 'capital_snake': 'Capital_Snake', # noqa: E501 - 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 - 'att_name': 'ATT_NAME' # noqa: E501 - } - - openapi_types = { - 'small_camel': (str,), # noqa: E501 - 'capital_camel': (str,), # noqa: E501 - 'small_snake': (str,), # noqa: E501 - 'capital_snake': (str,), # noqa: E501 - 'sca_eth_flow_points': (str,), # noqa: E501 - 'att_name': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Capitalization - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - small_camel (str): [optional] # noqa: E501 - capital_camel (str): [optional] # noqa: E501 - small_snake (str): [optional] # noqa: E501 - capital_snake (str): [optional] # noqa: E501 - sca_eth_flow_points (str): [optional] # noqa: E501 - att_name (str): Name of the pet . [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def small_camel(self): - """Gets the small_camel of this Capitalization. # noqa: E501 - - Returns: - (str): The small_camel of this Capitalization. # noqa: E501 - """ - return self.__get_item('small_camel') - - @small_camel.setter - def small_camel(self, value): - """Sets the small_camel of this Capitalization. # noqa: E501 - """ - return self.__set_item('small_camel', value) - - @property - def capital_camel(self): - """Gets the capital_camel of this Capitalization. # noqa: E501 - - Returns: - (str): The capital_camel of this Capitalization. # noqa: E501 - """ - return self.__get_item('capital_camel') - - @capital_camel.setter - def capital_camel(self, value): - """Sets the capital_camel of this Capitalization. # noqa: E501 - """ - return self.__set_item('capital_camel', value) - - @property - def small_snake(self): - """Gets the small_snake of this Capitalization. # noqa: E501 - - Returns: - (str): The small_snake of this Capitalization. # noqa: E501 - """ - return self.__get_item('small_snake') - - @small_snake.setter - def small_snake(self, value): - """Sets the small_snake of this Capitalization. # noqa: E501 - """ - return self.__set_item('small_snake', value) - - @property - def capital_snake(self): - """Gets the capital_snake of this Capitalization. # noqa: E501 - - Returns: - (str): The capital_snake of this Capitalization. # noqa: E501 - """ - return self.__get_item('capital_snake') - - @capital_snake.setter - def capital_snake(self, value): - """Sets the capital_snake of this Capitalization. # noqa: E501 - """ - return self.__set_item('capital_snake', value) - - @property - def sca_eth_flow_points(self): - """Gets the sca_eth_flow_points of this Capitalization. # noqa: E501 - - Returns: - (str): The sca_eth_flow_points of this Capitalization. # noqa: E501 - """ - return self.__get_item('sca_eth_flow_points') - - @sca_eth_flow_points.setter - def sca_eth_flow_points(self, value): - """Sets the sca_eth_flow_points of this Capitalization. # noqa: E501 - """ - return self.__set_item('sca_eth_flow_points', value) - - @property - def att_name(self): - """Gets the att_name of this Capitalization. # noqa: E501 - Name of the pet # noqa: E501 - - Returns: - (str): The att_name of this Capitalization. # noqa: E501 - """ - return self.__get_item('att_name') - - @att_name.setter - def att_name(self, value): - """Sets the att_name of this Capitalization. # noqa: E501 - Name of the pet # noqa: E501 - """ - return self.__set_item('att_name', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Capitalization): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py deleted file mode 100644 index 40508dd3ce79..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py +++ /dev/null @@ -1,272 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Cat(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'color': 'color', # noqa: E501 - 'declawed': 'declawed' # noqa: E501 - } - - openapi_types = { - 'class_name': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'declawed': (bool,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Cat - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - declawed (bool): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('class_name', class_name) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def class_name(self): - """Gets the class_name of this Cat. # noqa: E501 - - Returns: - (str): The class_name of this Cat. # noqa: E501 - """ - return self.__get_item('class_name') - - @class_name.setter - def class_name(self, value): - """Sets the class_name of this Cat. # noqa: E501 - """ - return self.__set_item('class_name', value) - - @property - def color(self): - """Gets the color of this Cat. # noqa: E501 - - Returns: - (str): The color of this Cat. # noqa: E501 - """ - return self.__get_item('color') - - @color.setter - def color(self, value): - """Sets the color of this Cat. # noqa: E501 - """ - return self.__set_item('color', value) - - @property - def declawed(self): - """Gets the declawed of this Cat. # noqa: E501 - - Returns: - (bool): The declawed of this Cat. # noqa: E501 - """ - return self.__get_item('declawed') - - @declawed.setter - def declawed(self, value): - """Sets the declawed of this Cat. # noqa: E501 - """ - return self.__set_item('declawed', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Cat): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py deleted file mode 100644 index cb1f0d815a0f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class CatAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'declawed': 'declawed' # noqa: E501 - } - - openapi_types = { - 'declawed': (bool,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """CatAllOf - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - declawed (bool): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def declawed(self): - """Gets the declawed of this CatAllOf. # noqa: E501 - - Returns: - (bool): The declawed of this CatAllOf. # noqa: E501 - """ - return self.__get_item('declawed') - - @declawed.setter - def declawed(self, value): - """Sets the declawed of this CatAllOf. # noqa: E501 - """ - return self.__set_item('declawed', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, CatAllOf): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py deleted file mode 100644 index ca367ad9c3d2..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py +++ /dev/null @@ -1,254 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Category(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'id': 'id', # noqa: E501 - 'name': 'name' # noqa: E501 - } - - openapi_types = { - 'id': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, name='default-name', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Category - a model defined in OpenAPI - - Args: - - Keyword Args: - name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - id (int): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('name', name) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def id(self): - """Gets the id of this Category. # noqa: E501 - - Returns: - (int): The id of this Category. # noqa: E501 - """ - return self.__get_item('id') - - @id.setter - def id(self, value): - """Sets the id of this Category. # noqa: E501 - """ - return self.__set_item('id', value) - - @property - def name(self): - """Gets the name of this Category. # noqa: E501 - - Returns: - (str): The name of this Category. # noqa: E501 - """ - return self.__get_item('name') - - @name.setter - def name(self, value): - """Sets the name of this Category. # noqa: E501 - """ - return self.__set_item('name', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Category): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py deleted file mode 100644 index b44cdb80aae0..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class ClassModel(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - '_class': '_class' # noqa: E501 - } - - openapi_types = { - '_class': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """ClassModel - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _class (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def _class(self): - """Gets the _class of this ClassModel. # noqa: E501 - - Returns: - (str): The _class of this ClassModel. # noqa: E501 - """ - return self.__get_item('_class') - - @_class.setter - def _class(self, value): - """Sets the _class of this ClassModel. # noqa: E501 - """ - return self.__set_item('_class', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ClassModel): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py deleted file mode 100644 index 5e1699a2196b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Client(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'client': 'client' # noqa: E501 - } - - openapi_types = { - 'client': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Client - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - client (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def client(self): - """Gets the client of this Client. # noqa: E501 - - Returns: - (str): The client of this Client. # noqa: E501 - """ - return self.__get_item('client') - - @client.setter - def client(self, value): - """Sets the client of this Client. # noqa: E501 - """ - return self.__set_item('client', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Client): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py deleted file mode 100644 index bac013b867d9..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py +++ /dev/null @@ -1,272 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Dog(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'class_name': 'className', # noqa: E501 - 'color': 'color', # noqa: E501 - 'breed': 'breed' # noqa: E501 - } - - openapi_types = { - 'class_name': (str,), # noqa: E501 - 'color': (str,), # noqa: E501 - 'breed': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Dog - a model defined in OpenAPI - - Args: - class_name (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - breed (str): [optional] # noqa: E501 - color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('class_name', class_name) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def class_name(self): - """Gets the class_name of this Dog. # noqa: E501 - - Returns: - (str): The class_name of this Dog. # noqa: E501 - """ - return self.__get_item('class_name') - - @class_name.setter - def class_name(self, value): - """Sets the class_name of this Dog. # noqa: E501 - """ - return self.__set_item('class_name', value) - - @property - def color(self): - """Gets the color of this Dog. # noqa: E501 - - Returns: - (str): The color of this Dog. # noqa: E501 - """ - return self.__get_item('color') - - @color.setter - def color(self, value): - """Sets the color of this Dog. # noqa: E501 - """ - return self.__set_item('color', value) - - @property - def breed(self): - """Gets the breed of this Dog. # noqa: E501 - - Returns: - (str): The breed of this Dog. # noqa: E501 - """ - return self.__get_item('breed') - - @breed.setter - def breed(self, value): - """Sets the breed of this Dog. # noqa: E501 - """ - return self.__set_item('breed', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Dog): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py deleted file mode 100644 index 7d9a33bbe365..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class DogAllOf(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'breed': 'breed' # noqa: E501 - } - - openapi_types = { - 'breed': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """DogAllOf - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - breed (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def breed(self): - """Gets the breed of this DogAllOf. # noqa: E501 - - Returns: - (str): The breed of this DogAllOf. # noqa: E501 - """ - return self.__get_item('breed') - - @breed.setter - def breed(self, value): - """Sets the breed of this DogAllOf. # noqa: E501 - """ - return self.__set_item('breed', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DogAllOf): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py deleted file mode 100644 index 477193e858f4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py +++ /dev/null @@ -1,260 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class EnumArrays(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('just_symbol',): { - '>=': ">=", - '$': "$", - }, - ('array_enum',): { - 'FISH': "fish", - 'CRAB': "crab", - }, - } - - attribute_map = { - 'just_symbol': 'just_symbol', # noqa: E501 - 'array_enum': 'array_enum' # noqa: E501 - } - - openapi_types = { - 'just_symbol': (str,), # noqa: E501 - 'array_enum': ([str],), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """EnumArrays - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - just_symbol (str): [optional] # noqa: E501 - array_enum ([str]): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def just_symbol(self): - """Gets the just_symbol of this EnumArrays. # noqa: E501 - - Returns: - (str): The just_symbol of this EnumArrays. # noqa: E501 - """ - return self.__get_item('just_symbol') - - @just_symbol.setter - def just_symbol(self, value): - """Sets the just_symbol of this EnumArrays. # noqa: E501 - """ - return self.__set_item('just_symbol', value) - - @property - def array_enum(self): - """Gets the array_enum of this EnumArrays. # noqa: E501 - - Returns: - ([str]): The array_enum of this EnumArrays. # noqa: E501 - """ - return self.__get_item('array_enum') - - @array_enum.setter - def array_enum(self, value): - """Sets the array_enum of this EnumArrays. # noqa: E501 - """ - return self.__set_item('array_enum', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumArrays): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py deleted file mode 100644 index 0b3bca10a53e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py +++ /dev/null @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class EnumClass(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '_ABC': "_abc", - '-EFG': "-efg", - '(XYZ)': "(xyz)", - }, - } - - openapi_types = { - 'value': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """EnumClass - a model defined in OpenAPI - - Args: - - Keyword Args: - value (str): defaults to '-efg', must be one of ['-efg'] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('value', value) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def value(self): - """Gets the value of this EnumClass. # noqa: E501 - - Returns: - (str): The value of this EnumClass. # noqa: E501 - """ - return self.__get_item('value') - - @value.setter - def value(self, value): - """Sets the value of this EnumClass. # noqa: E501 - """ - return self.__set_item('value', value) - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumClass): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py deleted file mode 100644 index b2db47a8573d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ /dev/null @@ -1,384 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.outer_enum import OuterEnum -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue -from petstore_api.models.outer_enum_integer import OuterEnumInteger -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue - - -class EnumTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_string_required',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - 'EMPTY': "", - }, - ('enum_integer',): { - '1': 1, - '-1': -1, - }, - ('enum_number',): { - '1.1': 1.1, - '-1.2': -1.2, - }, - } - - attribute_map = { - 'enum_string': 'enum_string', # noqa: E501 - 'enum_string_required': 'enum_string_required', # noqa: E501 - 'enum_integer': 'enum_integer', # noqa: E501 - 'enum_number': 'enum_number', # noqa: E501 - 'outer_enum': 'outerEnum', # noqa: E501 - 'outer_enum_integer': 'outerEnumInteger', # noqa: E501 - 'outer_enum_default_value': 'outerEnumDefaultValue', # noqa: E501 - 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue' # noqa: E501 - } - - openapi_types = { - 'enum_string': (str,), # noqa: E501 - 'enum_string_required': (str,), # noqa: E501 - 'enum_integer': (int,), # noqa: E501 - 'enum_number': (float,), # noqa: E501 - 'outer_enum': (OuterEnum,), # noqa: E501 - 'outer_enum_integer': (OuterEnumInteger,), # noqa: E501 - 'outer_enum_default_value': (OuterEnumDefaultValue,), # noqa: E501 - 'outer_enum_integer_default_value': (OuterEnumIntegerDefaultValue,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, enum_string_required, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """EnumTest - a model defined in OpenAPI - - Args: - enum_string_required (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - enum_string (str): [optional] # noqa: E501 - enum_integer (int): [optional] # noqa: E501 - enum_number (float): [optional] # noqa: E501 - outer_enum (OuterEnum): [optional] # noqa: E501 - outer_enum_integer (OuterEnumInteger): [optional] # noqa: E501 - outer_enum_default_value (OuterEnumDefaultValue): [optional] # noqa: E501 - outer_enum_integer_default_value (OuterEnumIntegerDefaultValue): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('enum_string_required', enum_string_required) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def enum_string(self): - """Gets the enum_string of this EnumTest. # noqa: E501 - - Returns: - (str): The enum_string of this EnumTest. # noqa: E501 - """ - return self.__get_item('enum_string') - - @enum_string.setter - def enum_string(self, value): - """Sets the enum_string of this EnumTest. # noqa: E501 - """ - return self.__set_item('enum_string', value) - - @property - def enum_string_required(self): - """Gets the enum_string_required of this EnumTest. # noqa: E501 - - Returns: - (str): The enum_string_required of this EnumTest. # noqa: E501 - """ - return self.__get_item('enum_string_required') - - @enum_string_required.setter - def enum_string_required(self, value): - """Sets the enum_string_required of this EnumTest. # noqa: E501 - """ - return self.__set_item('enum_string_required', value) - - @property - def enum_integer(self): - """Gets the enum_integer of this EnumTest. # noqa: E501 - - Returns: - (int): The enum_integer of this EnumTest. # noqa: E501 - """ - return self.__get_item('enum_integer') - - @enum_integer.setter - def enum_integer(self, value): - """Sets the enum_integer of this EnumTest. # noqa: E501 - """ - return self.__set_item('enum_integer', value) - - @property - def enum_number(self): - """Gets the enum_number of this EnumTest. # noqa: E501 - - Returns: - (float): The enum_number of this EnumTest. # noqa: E501 - """ - return self.__get_item('enum_number') - - @enum_number.setter - def enum_number(self, value): - """Sets the enum_number of this EnumTest. # noqa: E501 - """ - return self.__set_item('enum_number', value) - - @property - def outer_enum(self): - """Gets the outer_enum of this EnumTest. # noqa: E501 - - Returns: - (OuterEnum): The outer_enum of this EnumTest. # noqa: E501 - """ - return self.__get_item('outer_enum') - - @outer_enum.setter - def outer_enum(self, value): - """Sets the outer_enum of this EnumTest. # noqa: E501 - """ - return self.__set_item('outer_enum', value) - - @property - def outer_enum_integer(self): - """Gets the outer_enum_integer of this EnumTest. # noqa: E501 - - Returns: - (OuterEnumInteger): The outer_enum_integer of this EnumTest. # noqa: E501 - """ - return self.__get_item('outer_enum_integer') - - @outer_enum_integer.setter - def outer_enum_integer(self, value): - """Sets the outer_enum_integer of this EnumTest. # noqa: E501 - """ - return self.__set_item('outer_enum_integer', value) - - @property - def outer_enum_default_value(self): - """Gets the outer_enum_default_value of this EnumTest. # noqa: E501 - - Returns: - (OuterEnumDefaultValue): The outer_enum_default_value of this EnumTest. # noqa: E501 - """ - return self.__get_item('outer_enum_default_value') - - @outer_enum_default_value.setter - def outer_enum_default_value(self, value): - """Sets the outer_enum_default_value of this EnumTest. # noqa: E501 - """ - return self.__set_item('outer_enum_default_value', value) - - @property - def outer_enum_integer_default_value(self): - """Gets the outer_enum_integer_default_value of this EnumTest. # noqa: E501 - - Returns: - (OuterEnumIntegerDefaultValue): The outer_enum_integer_default_value of this EnumTest. # noqa: E501 - """ - return self.__get_item('outer_enum_integer_default_value') - - @outer_enum_integer_default_value.setter - def outer_enum_integer_default_value(self, value): - """Sets the outer_enum_integer_default_value of this EnumTest. # noqa: E501 - """ - return self.__set_item('outer_enum_integer_default_value', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, EnumTest): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py deleted file mode 100644 index 7da4e025a205..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py +++ /dev/null @@ -1,236 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class File(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'source_uri': 'sourceURI' # noqa: E501 - } - - openapi_types = { - 'source_uri': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """File - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - source_uri (str): Test capitalization. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def source_uri(self): - """Gets the source_uri of this File. # noqa: E501 - Test capitalization # noqa: E501 - - Returns: - (str): The source_uri of this File. # noqa: E501 - """ - return self.__get_item('source_uri') - - @source_uri.setter - def source_uri(self, value): - """Sets the source_uri of this File. # noqa: E501 - Test capitalization # noqa: E501 - """ - return self.__set_item('source_uri', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, File): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py deleted file mode 100644 index 5e0ca0498d9a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ /dev/null @@ -1,253 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.file import File - - -class FileSchemaTestClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'file': 'file', # noqa: E501 - 'files': 'files' # noqa: E501 - } - - openapi_types = { - 'file': (File,), # noqa: E501 - 'files': ([File],), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """FileSchemaTestClass - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - file (File): [optional] # noqa: E501 - files ([File]): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def file(self): - """Gets the file of this FileSchemaTestClass. # noqa: E501 - - Returns: - (File): The file of this FileSchemaTestClass. # noqa: E501 - """ - return self.__get_item('file') - - @file.setter - def file(self, value): - """Sets the file of this FileSchemaTestClass. # noqa: E501 - """ - return self.__set_item('file', value) - - @property - def files(self): - """Gets the files of this FileSchemaTestClass. # noqa: E501 - - Returns: - ([File]): The files of this FileSchemaTestClass. # noqa: E501 - """ - return self.__get_item('files') - - @files.setter - def files(self, value): - """Sets the files of this FileSchemaTestClass. # noqa: E501 - """ - return self.__set_item('files', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FileSchemaTestClass): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py deleted file mode 100644 index 60997bcf82d3..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Foo(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'bar': 'bar' # noqa: E501 - } - - openapi_types = { - 'bar': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Foo - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - bar (str): [optional] if omitted the server will use the default value of 'bar' # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def bar(self): - """Gets the bar of this Foo. # noqa: E501 - - Returns: - (str): The bar of this Foo. # noqa: E501 - """ - return self.__get_item('bar') - - @bar.setter - def bar(self, value): - """Sets the bar of this Foo. # noqa: E501 - """ - return self.__set_item('bar', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Foo): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py deleted file mode 100644 index 85304db27f5a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py +++ /dev/null @@ -1,536 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class FormatTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'integer': 'integer', # noqa: E501 - 'int32': 'int32', # noqa: E501 - 'int64': 'int64', # noqa: E501 - 'number': 'number', # noqa: E501 - 'float': 'float', # noqa: E501 - 'double': 'double', # noqa: E501 - 'string': 'string', # noqa: E501 - 'byte': 'byte', # noqa: E501 - 'binary': 'binary', # noqa: E501 - 'date': 'date', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'uuid': 'uuid', # noqa: E501 - 'password': 'password', # noqa: E501 - 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 - 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter' # noqa: E501 - } - - openapi_types = { - 'integer': (int,), # noqa: E501 - 'int32': (int,), # noqa: E501 - 'int64': (int,), # noqa: E501 - 'number': (float,), # noqa: E501 - 'float': (float,), # noqa: E501 - 'double': (float,), # noqa: E501 - 'string': (str,), # noqa: E501 - 'byte': (str,), # noqa: E501 - 'binary': (file_type,), # noqa: E501 - 'date': (date,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'uuid': (str,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'pattern_with_digits': (str,), # noqa: E501 - 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 - } - - validations = { - ('integer',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('number',): { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('float',): { - 'inclusive_maximum': 987.6, - 'inclusive_minimum': 54.3, - }, - ('double',): { - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('string',): { - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - ('pattern_with_digits',): { - 'regex': { - 'pattern': r'^\d{10}$', # noqa: E501 - }, - }, - ('pattern_with_digits_and_delimiter',): { - 'regex': { - 'pattern': r'^image_\d{1,3}$', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, number, byte, date, password, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """FormatTest - a model defined in OpenAPI - - Args: - number (float): - byte (str): - date (date): - password (str): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - integer (int): [optional] # noqa: E501 - int32 (int): [optional] # noqa: E501 - int64 (int): [optional] # noqa: E501 - float (float): [optional] # noqa: E501 - double (float): [optional] # noqa: E501 - string (str): [optional] # noqa: E501 - binary (file_type): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - uuid (str): [optional] # noqa: E501 - pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 - pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('number', number) - self.__set_item('byte', byte) - self.__set_item('date', date) - self.__set_item('password', password) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def integer(self): - """Gets the integer of this FormatTest. # noqa: E501 - - Returns: - (int): The integer of this FormatTest. # noqa: E501 - """ - return self.__get_item('integer') - - @integer.setter - def integer(self, value): - """Sets the integer of this FormatTest. # noqa: E501 - """ - return self.__set_item('integer', value) - - @property - def int32(self): - """Gets the int32 of this FormatTest. # noqa: E501 - - Returns: - (int): The int32 of this FormatTest. # noqa: E501 - """ - return self.__get_item('int32') - - @int32.setter - def int32(self, value): - """Sets the int32 of this FormatTest. # noqa: E501 - """ - return self.__set_item('int32', value) - - @property - def int64(self): - """Gets the int64 of this FormatTest. # noqa: E501 - - Returns: - (int): The int64 of this FormatTest. # noqa: E501 - """ - return self.__get_item('int64') - - @int64.setter - def int64(self, value): - """Sets the int64 of this FormatTest. # noqa: E501 - """ - return self.__set_item('int64', value) - - @property - def number(self): - """Gets the number of this FormatTest. # noqa: E501 - - Returns: - (float): The number of this FormatTest. # noqa: E501 - """ - return self.__get_item('number') - - @number.setter - def number(self, value): - """Sets the number of this FormatTest. # noqa: E501 - """ - return self.__set_item('number', value) - - @property - def float(self): - """Gets the float of this FormatTest. # noqa: E501 - - Returns: - (float): The float of this FormatTest. # noqa: E501 - """ - return self.__get_item('float') - - @float.setter - def float(self, value): - """Sets the float of this FormatTest. # noqa: E501 - """ - return self.__set_item('float', value) - - @property - def double(self): - """Gets the double of this FormatTest. # noqa: E501 - - Returns: - (float): The double of this FormatTest. # noqa: E501 - """ - return self.__get_item('double') - - @double.setter - def double(self, value): - """Sets the double of this FormatTest. # noqa: E501 - """ - return self.__set_item('double', value) - - @property - def string(self): - """Gets the string of this FormatTest. # noqa: E501 - - Returns: - (str): The string of this FormatTest. # noqa: E501 - """ - return self.__get_item('string') - - @string.setter - def string(self, value): - """Sets the string of this FormatTest. # noqa: E501 - """ - return self.__set_item('string', value) - - @property - def byte(self): - """Gets the byte of this FormatTest. # noqa: E501 - - Returns: - (str): The byte of this FormatTest. # noqa: E501 - """ - return self.__get_item('byte') - - @byte.setter - def byte(self, value): - """Sets the byte of this FormatTest. # noqa: E501 - """ - return self.__set_item('byte', value) - - @property - def binary(self): - """Gets the binary of this FormatTest. # noqa: E501 - - Returns: - (file_type): The binary of this FormatTest. # noqa: E501 - """ - return self.__get_item('binary') - - @binary.setter - def binary(self, value): - """Sets the binary of this FormatTest. # noqa: E501 - """ - return self.__set_item('binary', value) - - @property - def date(self): - """Gets the date of this FormatTest. # noqa: E501 - - Returns: - (date): The date of this FormatTest. # noqa: E501 - """ - return self.__get_item('date') - - @date.setter - def date(self, value): - """Sets the date of this FormatTest. # noqa: E501 - """ - return self.__set_item('date', value) - - @property - def date_time(self): - """Gets the date_time of this FormatTest. # noqa: E501 - - Returns: - (datetime): The date_time of this FormatTest. # noqa: E501 - """ - return self.__get_item('date_time') - - @date_time.setter - def date_time(self, value): - """Sets the date_time of this FormatTest. # noqa: E501 - """ - return self.__set_item('date_time', value) - - @property - def uuid(self): - """Gets the uuid of this FormatTest. # noqa: E501 - - Returns: - (str): The uuid of this FormatTest. # noqa: E501 - """ - return self.__get_item('uuid') - - @uuid.setter - def uuid(self, value): - """Sets the uuid of this FormatTest. # noqa: E501 - """ - return self.__set_item('uuid', value) - - @property - def password(self): - """Gets the password of this FormatTest. # noqa: E501 - - Returns: - (str): The password of this FormatTest. # noqa: E501 - """ - return self.__get_item('password') - - @password.setter - def password(self, value): - """Sets the password of this FormatTest. # noqa: E501 - """ - return self.__set_item('password', value) - - @property - def pattern_with_digits(self): - """Gets the pattern_with_digits of this FormatTest. # noqa: E501 - A string that is a 10 digit number. Can have leading zeros. # noqa: E501 - - Returns: - (str): The pattern_with_digits of this FormatTest. # noqa: E501 - """ - return self.__get_item('pattern_with_digits') - - @pattern_with_digits.setter - def pattern_with_digits(self, value): - """Sets the pattern_with_digits of this FormatTest. # noqa: E501 - A string that is a 10 digit number. Can have leading zeros. # noqa: E501 - """ - return self.__set_item('pattern_with_digits', value) - - @property - def pattern_with_digits_and_delimiter(self): - """Gets the pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 - - Returns: - (str): The pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 - """ - return self.__get_item('pattern_with_digits_and_delimiter') - - @pattern_with_digits_and_delimiter.setter - def pattern_with_digits_and_delimiter(self, value): - """Sets the pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. # noqa: E501 - """ - return self.__set_item('pattern_with_digits_and_delimiter', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, FormatTest): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py deleted file mode 100644 index ecf201d21e81..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py +++ /dev/null @@ -1,252 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class HasOnlyReadOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'foo': 'foo' # noqa: E501 - } - - openapi_types = { - 'bar': (str,), # noqa: E501 - 'foo': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """HasOnlyReadOnly - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - bar (str): [optional] # noqa: E501 - foo (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def bar(self): - """Gets the bar of this HasOnlyReadOnly. # noqa: E501 - - Returns: - (str): The bar of this HasOnlyReadOnly. # noqa: E501 - """ - return self.__get_item('bar') - - @bar.setter - def bar(self, value): - """Sets the bar of this HasOnlyReadOnly. # noqa: E501 - """ - return self.__set_item('bar', value) - - @property - def foo(self): - """Gets the foo of this HasOnlyReadOnly. # noqa: E501 - - Returns: - (str): The foo of this HasOnlyReadOnly. # noqa: E501 - """ - return self.__get_item('foo') - - @foo.setter - def foo(self, value): - """Sets the foo of this HasOnlyReadOnly. # noqa: E501 - """ - return self.__set_item('foo', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HasOnlyReadOnly): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py deleted file mode 100644 index 9da7bc6f3939..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class HealthCheckResult(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'nullable_message': 'NullableMessage' # noqa: E501 - } - - openapi_types = { - 'nullable_message': (str, none_type,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """HealthCheckResult - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - nullable_message (str, none_type): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def nullable_message(self): - """Gets the nullable_message of this HealthCheckResult. # noqa: E501 - - Returns: - (str, none_type): The nullable_message of this HealthCheckResult. # noqa: E501 - """ - return self.__get_item('nullable_message') - - @nullable_message.setter - def nullable_message(self, value): - """Sets the nullable_message of this HealthCheckResult. # noqa: E501 - """ - return self.__set_item('nullable_message', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HealthCheckResult): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py deleted file mode 100644 index f91a27142a47..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py +++ /dev/null @@ -1,256 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class InlineObject(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'name': 'name', # noqa: E501 - 'status': 'status' # noqa: E501 - } - - openapi_types = { - 'name': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """InlineObject - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - name (str): Updated name of the pet. [optional] # noqa: E501 - status (str): Updated status of the pet. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def name(self): - """Gets the name of this InlineObject. # noqa: E501 - Updated name of the pet # noqa: E501 - - Returns: - (str): The name of this InlineObject. # noqa: E501 - """ - return self.__get_item('name') - - @name.setter - def name(self, value): - """Sets the name of this InlineObject. # noqa: E501 - Updated name of the pet # noqa: E501 - """ - return self.__set_item('name', value) - - @property - def status(self): - """Gets the status of this InlineObject. # noqa: E501 - Updated status of the pet # noqa: E501 - - Returns: - (str): The status of this InlineObject. # noqa: E501 - """ - return self.__get_item('status') - - @status.setter - def status(self, value): - """Sets the status of this InlineObject. # noqa: E501 - Updated status of the pet # noqa: E501 - """ - return self.__set_item('status', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py deleted file mode 100644 index 85fe82650f34..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py +++ /dev/null @@ -1,256 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class InlineObject1(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'additional_metadata': 'additionalMetadata', # noqa: E501 - 'file': 'file' # noqa: E501 - } - - openapi_types = { - 'additional_metadata': (str,), # noqa: E501 - 'file': (file_type,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """InlineObject1 - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 - file (file_type): file to upload. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def additional_metadata(self): - """Gets the additional_metadata of this InlineObject1. # noqa: E501 - Additional data to pass to server # noqa: E501 - - Returns: - (str): The additional_metadata of this InlineObject1. # noqa: E501 - """ - return self.__get_item('additional_metadata') - - @additional_metadata.setter - def additional_metadata(self, value): - """Sets the additional_metadata of this InlineObject1. # noqa: E501 - Additional data to pass to server # noqa: E501 - """ - return self.__set_item('additional_metadata', value) - - @property - def file(self): - """Gets the file of this InlineObject1. # noqa: E501 - file to upload # noqa: E501 - - Returns: - (file_type): The file of this InlineObject1. # noqa: E501 - """ - return self.__get_item('file') - - @file.setter - def file(self, value): - """Sets the file of this InlineObject1. # noqa: E501 - file to upload # noqa: E501 - """ - return self.__set_item('file', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject1): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py deleted file mode 100644 index 30513dbafe98..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py +++ /dev/null @@ -1,265 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class InlineObject2(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('enum_form_string_array',): { - '>': ">", - '$': "$", - }, - ('enum_form_string',): { - '_ABC': "_abc", - '-EFG': "-efg", - '(XYZ)': "(xyz)", - }, - } - - attribute_map = { - 'enum_form_string_array': 'enum_form_string_array', # noqa: E501 - 'enum_form_string': 'enum_form_string' # noqa: E501 - } - - openapi_types = { - 'enum_form_string_array': ([str],), # noqa: E501 - 'enum_form_string': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """InlineObject2 - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - enum_form_string_array ([str]): Form parameter enum test (string array). [optional] # noqa: E501 - enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def enum_form_string_array(self): - """Gets the enum_form_string_array of this InlineObject2. # noqa: E501 - Form parameter enum test (string array) # noqa: E501 - - Returns: - ([str]): The enum_form_string_array of this InlineObject2. # noqa: E501 - """ - return self.__get_item('enum_form_string_array') - - @enum_form_string_array.setter - def enum_form_string_array(self, value): - """Sets the enum_form_string_array of this InlineObject2. # noqa: E501 - Form parameter enum test (string array) # noqa: E501 - """ - return self.__set_item('enum_form_string_array', value) - - @property - def enum_form_string(self): - """Gets the enum_form_string of this InlineObject2. # noqa: E501 - Form parameter enum test (string) # noqa: E501 - - Returns: - (str): The enum_form_string of this InlineObject2. # noqa: E501 - """ - return self.__get_item('enum_form_string') - - @enum_form_string.setter - def enum_form_string(self, value): - """Sets the enum_form_string of this InlineObject2. # noqa: E501 - Form parameter enum test (string) # noqa: E501 - """ - return self.__set_item('enum_form_string', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject2): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py deleted file mode 100644 index fa2710feeb59..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py +++ /dev/null @@ -1,535 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class InlineObject3(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'integer': 'integer', # noqa: E501 - 'int32': 'int32', # noqa: E501 - 'int64': 'int64', # noqa: E501 - 'number': 'number', # noqa: E501 - 'float': 'float', # noqa: E501 - 'double': 'double', # noqa: E501 - 'string': 'string', # noqa: E501 - 'pattern_without_delimiter': 'pattern_without_delimiter', # noqa: E501 - 'byte': 'byte', # noqa: E501 - 'binary': 'binary', # noqa: E501 - 'date': 'date', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'password': 'password', # noqa: E501 - 'callback': 'callback' # noqa: E501 - } - - openapi_types = { - 'integer': (int,), # noqa: E501 - 'int32': (int,), # noqa: E501 - 'int64': (int,), # noqa: E501 - 'number': (float,), # noqa: E501 - 'float': (float,), # noqa: E501 - 'double': (float,), # noqa: E501 - 'string': (str,), # noqa: E501 - 'pattern_without_delimiter': (str,), # noqa: E501 - 'byte': (str,), # noqa: E501 - 'binary': (file_type,), # noqa: E501 - 'date': (date,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'callback': (str,), # noqa: E501 - } - - validations = { - ('integer',): { - 'inclusive_maximum': 100, - 'inclusive_minimum': 10, - }, - ('int32',): { - 'inclusive_maximum': 200, - 'inclusive_minimum': 20, - }, - ('number',): { - 'inclusive_maximum': 543.2, - 'inclusive_minimum': 32.1, - }, - ('float',): { - 'inclusive_maximum': 987.6, - }, - ('double',): { - 'inclusive_maximum': 123.4, - 'inclusive_minimum': 67.8, - }, - ('string',): { - 'regex': { - 'pattern': r'[a-z]', # noqa: E501 - 'flags': (re.IGNORECASE) - }, - }, - ('pattern_without_delimiter',): { - 'regex': { - 'pattern': r'^[A-Z].*', # noqa: E501 - }, - }, - ('password',): { - 'max_length': 64, - 'min_length': 10, - }, - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, number, double, pattern_without_delimiter, byte, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """InlineObject3 - a model defined in OpenAPI - - Args: - number (float): None - double (float): None - pattern_without_delimiter (str): None - byte (str): None - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - integer (int): None. [optional] # noqa: E501 - int32 (int): None. [optional] # noqa: E501 - int64 (int): None. [optional] # noqa: E501 - float (float): None. [optional] # noqa: E501 - string (str): None. [optional] # noqa: E501 - binary (file_type): None. [optional] # noqa: E501 - date (date): None. [optional] # noqa: E501 - date_time (datetime): None. [optional] # noqa: E501 - password (str): None. [optional] # noqa: E501 - callback (str): None. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('number', number) - self.__set_item('double', double) - self.__set_item('pattern_without_delimiter', pattern_without_delimiter) - self.__set_item('byte', byte) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def integer(self): - """Gets the integer of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (int): The integer of this InlineObject3. # noqa: E501 - """ - return self.__get_item('integer') - - @integer.setter - def integer(self, value): - """Sets the integer of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('integer', value) - - @property - def int32(self): - """Gets the int32 of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (int): The int32 of this InlineObject3. # noqa: E501 - """ - return self.__get_item('int32') - - @int32.setter - def int32(self, value): - """Sets the int32 of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('int32', value) - - @property - def int64(self): - """Gets the int64 of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (int): The int64 of this InlineObject3. # noqa: E501 - """ - return self.__get_item('int64') - - @int64.setter - def int64(self, value): - """Sets the int64 of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('int64', value) - - @property - def number(self): - """Gets the number of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (float): The number of this InlineObject3. # noqa: E501 - """ - return self.__get_item('number') - - @number.setter - def number(self, value): - """Sets the number of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('number', value) - - @property - def float(self): - """Gets the float of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (float): The float of this InlineObject3. # noqa: E501 - """ - return self.__get_item('float') - - @float.setter - def float(self, value): - """Sets the float of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('float', value) - - @property - def double(self): - """Gets the double of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (float): The double of this InlineObject3. # noqa: E501 - """ - return self.__get_item('double') - - @double.setter - def double(self, value): - """Sets the double of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('double', value) - - @property - def string(self): - """Gets the string of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (str): The string of this InlineObject3. # noqa: E501 - """ - return self.__get_item('string') - - @string.setter - def string(self, value): - """Sets the string of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('string', value) - - @property - def pattern_without_delimiter(self): - """Gets the pattern_without_delimiter of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (str): The pattern_without_delimiter of this InlineObject3. # noqa: E501 - """ - return self.__get_item('pattern_without_delimiter') - - @pattern_without_delimiter.setter - def pattern_without_delimiter(self, value): - """Sets the pattern_without_delimiter of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('pattern_without_delimiter', value) - - @property - def byte(self): - """Gets the byte of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (str): The byte of this InlineObject3. # noqa: E501 - """ - return self.__get_item('byte') - - @byte.setter - def byte(self, value): - """Sets the byte of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('byte', value) - - @property - def binary(self): - """Gets the binary of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (file_type): The binary of this InlineObject3. # noqa: E501 - """ - return self.__get_item('binary') - - @binary.setter - def binary(self, value): - """Sets the binary of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('binary', value) - - @property - def date(self): - """Gets the date of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (date): The date of this InlineObject3. # noqa: E501 - """ - return self.__get_item('date') - - @date.setter - def date(self, value): - """Sets the date of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('date', value) - - @property - def date_time(self): - """Gets the date_time of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (datetime): The date_time of this InlineObject3. # noqa: E501 - """ - return self.__get_item('date_time') - - @date_time.setter - def date_time(self, value): - """Sets the date_time of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('date_time', value) - - @property - def password(self): - """Gets the password of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (str): The password of this InlineObject3. # noqa: E501 - """ - return self.__get_item('password') - - @password.setter - def password(self, value): - """Sets the password of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('password', value) - - @property - def callback(self): - """Gets the callback of this InlineObject3. # noqa: E501 - None # noqa: E501 - - Returns: - (str): The callback of this InlineObject3. # noqa: E501 - """ - return self.__get_item('callback') - - @callback.setter - def callback(self, value): - """Sets the callback of this InlineObject3. # noqa: E501 - None # noqa: E501 - """ - return self.__set_item('callback', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject3): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py deleted file mode 100644 index f77211884ada..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py +++ /dev/null @@ -1,259 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class InlineObject4(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'param': 'param', # noqa: E501 - 'param2': 'param2' # noqa: E501 - } - - openapi_types = { - 'param': (str,), # noqa: E501 - 'param2': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """InlineObject4 - a model defined in OpenAPI - - Args: - param (str): field1 - param2 (str): field2 - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('param', param) - self.__set_item('param2', param2) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def param(self): - """Gets the param of this InlineObject4. # noqa: E501 - field1 # noqa: E501 - - Returns: - (str): The param of this InlineObject4. # noqa: E501 - """ - return self.__get_item('param') - - @param.setter - def param(self, value): - """Sets the param of this InlineObject4. # noqa: E501 - field1 # noqa: E501 - """ - return self.__set_item('param', value) - - @property - def param2(self): - """Gets the param2 of this InlineObject4. # noqa: E501 - field2 # noqa: E501 - - Returns: - (str): The param2 of this InlineObject4. # noqa: E501 - """ - return self.__get_item('param2') - - @param2.setter - def param2(self, value): - """Sets the param2 of this InlineObject4. # noqa: E501 - field2 # noqa: E501 - """ - return self.__set_item('param2', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject4): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py deleted file mode 100644 index b143ac20ee95..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py +++ /dev/null @@ -1,258 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class InlineObject5(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'additional_metadata': 'additionalMetadata', # noqa: E501 - 'required_file': 'requiredFile' # noqa: E501 - } - - openapi_types = { - 'additional_metadata': (str,), # noqa: E501 - 'required_file': (file_type,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, required_file, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """InlineObject5 - a model defined in OpenAPI - - Args: - required_file (file_type): file to upload - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('required_file', required_file) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def additional_metadata(self): - """Gets the additional_metadata of this InlineObject5. # noqa: E501 - Additional data to pass to server # noqa: E501 - - Returns: - (str): The additional_metadata of this InlineObject5. # noqa: E501 - """ - return self.__get_item('additional_metadata') - - @additional_metadata.setter - def additional_metadata(self, value): - """Sets the additional_metadata of this InlineObject5. # noqa: E501 - Additional data to pass to server # noqa: E501 - """ - return self.__set_item('additional_metadata', value) - - @property - def required_file(self): - """Gets the required_file of this InlineObject5. # noqa: E501 - file to upload # noqa: E501 - - Returns: - (file_type): The required_file of this InlineObject5. # noqa: E501 - """ - return self.__get_item('required_file') - - @required_file.setter - def required_file(self, value): - """Sets the required_file of this InlineObject5. # noqa: E501 - file to upload # noqa: E501 - """ - return self.__set_item('required_file', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineObject5): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py deleted file mode 100644 index 52d6240613a1..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py +++ /dev/null @@ -1,235 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.foo import Foo - - -class InlineResponseDefault(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'string': 'string' # noqa: E501 - } - - openapi_types = { - 'string': (Foo,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """InlineResponseDefault - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - string (Foo): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def string(self): - """Gets the string of this InlineResponseDefault. # noqa: E501 - - Returns: - (Foo): The string of this InlineResponseDefault. # noqa: E501 - """ - return self.__get_item('string') - - @string.setter - def string(self, value): - """Sets the string of this InlineResponseDefault. # noqa: E501 - """ - return self.__set_item('string', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponseDefault): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py deleted file mode 100644 index 79ff6c81bede..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class List(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - '_123_list': '123-list' # noqa: E501 - } - - openapi_types = { - '_123_list': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """List - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _123_list (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def _123_list(self): - """Gets the _123_list of this List. # noqa: E501 - - Returns: - (str): The _123_list of this List. # noqa: E501 - """ - return self.__get_item('_123_list') - - @_123_list.setter - def _123_list(self, value): - """Sets the _123_list of this List. # noqa: E501 - """ - return self.__set_item('_123_list', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, List): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py deleted file mode 100644 index 84b07abdcc8d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py +++ /dev/null @@ -1,293 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.string_boolean_map import StringBooleanMap - - -class MapTest(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('map_of_enum_string',): { - 'UPPER': "UPPER", - 'LOWER': "lower", - }, - } - - attribute_map = { - 'map_map_of_string': 'map_map_of_string', # noqa: E501 - 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 - 'direct_map': 'direct_map', # noqa: E501 - 'indirect_map': 'indirect_map' # noqa: E501 - } - - openapi_types = { - 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 - 'map_of_enum_string': ({str: (str,)},), # noqa: E501 - 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (StringBooleanMap,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """MapTest - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 - map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 - direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (StringBooleanMap): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def map_map_of_string(self): - """Gets the map_map_of_string of this MapTest. # noqa: E501 - - Returns: - ({str: ({str: (str,)},)}): The map_map_of_string of this MapTest. # noqa: E501 - """ - return self.__get_item('map_map_of_string') - - @map_map_of_string.setter - def map_map_of_string(self, value): - """Sets the map_map_of_string of this MapTest. # noqa: E501 - """ - return self.__set_item('map_map_of_string', value) - - @property - def map_of_enum_string(self): - """Gets the map_of_enum_string of this MapTest. # noqa: E501 - - Returns: - ({str: (str,)}): The map_of_enum_string of this MapTest. # noqa: E501 - """ - return self.__get_item('map_of_enum_string') - - @map_of_enum_string.setter - def map_of_enum_string(self, value): - """Sets the map_of_enum_string of this MapTest. # noqa: E501 - """ - return self.__set_item('map_of_enum_string', value) - - @property - def direct_map(self): - """Gets the direct_map of this MapTest. # noqa: E501 - - Returns: - ({str: (bool,)}): The direct_map of this MapTest. # noqa: E501 - """ - return self.__get_item('direct_map') - - @direct_map.setter - def direct_map(self, value): - """Sets the direct_map of this MapTest. # noqa: E501 - """ - return self.__set_item('direct_map', value) - - @property - def indirect_map(self): - """Gets the indirect_map of this MapTest. # noqa: E501 - - Returns: - (StringBooleanMap): The indirect_map of this MapTest. # noqa: E501 - """ - return self.__get_item('indirect_map') - - @indirect_map.setter - def indirect_map(self, value): - """Sets the indirect_map of this MapTest. # noqa: E501 - """ - return self.__set_item('indirect_map', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MapTest): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py deleted file mode 100644 index a8f9efb42974..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,271 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.animal import Animal - - -class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'uuid': 'uuid', # noqa: E501 - 'date_time': 'dateTime', # noqa: E501 - 'map': 'map' # noqa: E501 - } - - openapi_types = { - 'uuid': (str,), # noqa: E501 - 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (Animal,)},), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - uuid (str): [optional] # noqa: E501 - date_time (datetime): [optional] # noqa: E501 - map ({str: (Animal,)}): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def uuid(self): - """Gets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - Returns: - (str): The uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - """ - return self.__get_item('uuid') - - @uuid.setter - def uuid(self, value): - """Sets the uuid of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - """ - return self.__set_item('uuid', value) - - @property - def date_time(self): - """Gets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - Returns: - (datetime): The date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - """ - return self.__get_item('date_time') - - @date_time.setter - def date_time(self, value): - """Sets the date_time of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - """ - return self.__set_item('date_time', value) - - @property - def map(self): - """Gets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - - Returns: - ({str: (Animal,)}): The map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - """ - return self.__get_item('map') - - @map.setter - def map(self, value): - """Sets the map of this MixedPropertiesAndAdditionalPropertiesClass. # noqa: E501 - """ - return self.__set_item('map', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py deleted file mode 100644 index 4bb72561e846..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py +++ /dev/null @@ -1,252 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Model200Response(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'name': 'name', # noqa: E501 - '_class': 'class' # noqa: E501 - } - - openapi_types = { - 'name': (int,), # noqa: E501 - '_class': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Model200Response - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - name (int): [optional] # noqa: E501 - _class (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def name(self): - """Gets the name of this Model200Response. # noqa: E501 - - Returns: - (int): The name of this Model200Response. # noqa: E501 - """ - return self.__get_item('name') - - @name.setter - def name(self, value): - """Sets the name of this Model200Response. # noqa: E501 - """ - return self.__set_item('name', value) - - @property - def _class(self): - """Gets the _class of this Model200Response. # noqa: E501 - - Returns: - (str): The _class of this Model200Response. # noqa: E501 - """ - return self.__get_item('_class') - - @_class.setter - def _class(self, value): - """Sets the _class of this Model200Response. # noqa: E501 - """ - return self.__set_item('_class', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model200Response): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py deleted file mode 100644 index 1ca322750bf4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class ModelReturn(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - '_return': 'return' # noqa: E501 - } - - openapi_types = { - '_return': (int,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """ModelReturn - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - _return (int): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def _return(self): - """Gets the _return of this ModelReturn. # noqa: E501 - - Returns: - (int): The _return of this ModelReturn. # noqa: E501 - """ - return self.__get_item('_return') - - @_return.setter - def _return(self, value): - """Sets the _return of this ModelReturn. # noqa: E501 - """ - return self.__set_item('_return', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ModelReturn): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py deleted file mode 100644 index b4c205ae08c9..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py +++ /dev/null @@ -1,290 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Name(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'name': 'name', # noqa: E501 - 'snake_case': 'snake_case', # noqa: E501 - '_property': 'property', # noqa: E501 - '_123_number': '123Number' # noqa: E501 - } - - openapi_types = { - 'name': (int,), # noqa: E501 - 'snake_case': (int,), # noqa: E501 - '_property': (str,), # noqa: E501 - '_123_number': (int,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Name - a model defined in OpenAPI - - Args: - name (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - snake_case (int): [optional] # noqa: E501 - _property (str): [optional] # noqa: E501 - _123_number (int): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('name', name) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def name(self): - """Gets the name of this Name. # noqa: E501 - - Returns: - (int): The name of this Name. # noqa: E501 - """ - return self.__get_item('name') - - @name.setter - def name(self, value): - """Sets the name of this Name. # noqa: E501 - """ - return self.__set_item('name', value) - - @property - def snake_case(self): - """Gets the snake_case of this Name. # noqa: E501 - - Returns: - (int): The snake_case of this Name. # noqa: E501 - """ - return self.__get_item('snake_case') - - @snake_case.setter - def snake_case(self, value): - """Sets the snake_case of this Name. # noqa: E501 - """ - return self.__set_item('snake_case', value) - - @property - def _property(self): - """Gets the _property of this Name. # noqa: E501 - - Returns: - (str): The _property of this Name. # noqa: E501 - """ - return self.__get_item('_property') - - @_property.setter - def _property(self, value): - """Sets the _property of this Name. # noqa: E501 - """ - return self.__set_item('_property', value) - - @property - def _123_number(self): - """Gets the _123_number of this Name. # noqa: E501 - - Returns: - (int): The _123_number of this Name. # noqa: E501 - """ - return self.__get_item('_123_number') - - @_123_number.setter - def _123_number(self, value): - """Sets the _123_number of this Name. # noqa: E501 - """ - return self.__set_item('_123_number', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Name): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py deleted file mode 100644 index 333baa12d124..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py +++ /dev/null @@ -1,432 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class NullableClass(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'integer_prop': 'integer_prop', # noqa: E501 - 'number_prop': 'number_prop', # noqa: E501 - 'boolean_prop': 'boolean_prop', # noqa: E501 - 'string_prop': 'string_prop', # noqa: E501 - 'date_prop': 'date_prop', # noqa: E501 - 'datetime_prop': 'datetime_prop', # noqa: E501 - 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 - 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 - 'array_items_nullable': 'array_items_nullable', # noqa: E501 - 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 - 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 - 'object_items_nullable': 'object_items_nullable' # noqa: E501 - } - - openapi_types = { - 'integer_prop': (int, none_type,), # noqa: E501 - 'number_prop': (float, none_type,), # noqa: E501 - 'boolean_prop': (bool, none_type,), # noqa: E501 - 'string_prop': (str, none_type,), # noqa: E501 - 'date_prop': (date, none_type,), # noqa: E501 - 'datetime_prop': (datetime, none_type,), # noqa: E501 - 'array_nullable_prop': ([bool, date, datetime, dict, float, int, list, str], none_type,), # noqa: E501 - 'array_and_items_nullable_prop': ([bool, date, datetime, dict, float, int, list, str, none_type], none_type,), # noqa: E501 - 'array_items_nullable': ([bool, date, datetime, dict, float, int, list, str, none_type],), # noqa: E501 - 'object_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type,), # noqa: E501 - 'object_and_items_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'object_items_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - } - - validations = { - } - - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """NullableClass - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - integer_prop (int, none_type): [optional] # noqa: E501 - number_prop (float, none_type): [optional] # noqa: E501 - boolean_prop (bool, none_type): [optional] # noqa: E501 - string_prop (str, none_type): [optional] # noqa: E501 - date_prop (date, none_type): [optional] # noqa: E501 - datetime_prop (datetime, none_type): [optional] # noqa: E501 - array_nullable_prop ([bool, date, datetime, dict, float, int, list, str], none_type): [optional] # noqa: E501 - array_and_items_nullable_prop ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): [optional] # noqa: E501 - array_items_nullable ([bool, date, datetime, dict, float, int, list, str, none_type]): [optional] # noqa: E501 - object_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): [optional] # noqa: E501 - object_and_items_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 - object_items_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def integer_prop(self): - """Gets the integer_prop of this NullableClass. # noqa: E501 - - Returns: - (int, none_type): The integer_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('integer_prop') - - @integer_prop.setter - def integer_prop(self, value): - """Sets the integer_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('integer_prop', value) - - @property - def number_prop(self): - """Gets the number_prop of this NullableClass. # noqa: E501 - - Returns: - (float, none_type): The number_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('number_prop') - - @number_prop.setter - def number_prop(self, value): - """Sets the number_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('number_prop', value) - - @property - def boolean_prop(self): - """Gets the boolean_prop of this NullableClass. # noqa: E501 - - Returns: - (bool, none_type): The boolean_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('boolean_prop') - - @boolean_prop.setter - def boolean_prop(self, value): - """Sets the boolean_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('boolean_prop', value) - - @property - def string_prop(self): - """Gets the string_prop of this NullableClass. # noqa: E501 - - Returns: - (str, none_type): The string_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('string_prop') - - @string_prop.setter - def string_prop(self, value): - """Sets the string_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('string_prop', value) - - @property - def date_prop(self): - """Gets the date_prop of this NullableClass. # noqa: E501 - - Returns: - (date, none_type): The date_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('date_prop') - - @date_prop.setter - def date_prop(self, value): - """Sets the date_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('date_prop', value) - - @property - def datetime_prop(self): - """Gets the datetime_prop of this NullableClass. # noqa: E501 - - Returns: - (datetime, none_type): The datetime_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('datetime_prop') - - @datetime_prop.setter - def datetime_prop(self, value): - """Sets the datetime_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('datetime_prop', value) - - @property - def array_nullable_prop(self): - """Gets the array_nullable_prop of this NullableClass. # noqa: E501 - - Returns: - ([bool, date, datetime, dict, float, int, list, str], none_type): The array_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('array_nullable_prop') - - @array_nullable_prop.setter - def array_nullable_prop(self, value): - """Sets the array_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('array_nullable_prop', value) - - @property - def array_and_items_nullable_prop(self): - """Gets the array_and_items_nullable_prop of this NullableClass. # noqa: E501 - - Returns: - ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): The array_and_items_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('array_and_items_nullable_prop') - - @array_and_items_nullable_prop.setter - def array_and_items_nullable_prop(self, value): - """Sets the array_and_items_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('array_and_items_nullable_prop', value) - - @property - def array_items_nullable(self): - """Gets the array_items_nullable of this NullableClass. # noqa: E501 - - Returns: - ([bool, date, datetime, dict, float, int, list, str, none_type]): The array_items_nullable of this NullableClass. # noqa: E501 - """ - return self.__get_item('array_items_nullable') - - @array_items_nullable.setter - def array_items_nullable(self, value): - """Sets the array_items_nullable of this NullableClass. # noqa: E501 - """ - return self.__set_item('array_items_nullable', value) - - @property - def object_nullable_prop(self): - """Gets the object_nullable_prop of this NullableClass. # noqa: E501 - - Returns: - ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): The object_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('object_nullable_prop') - - @object_nullable_prop.setter - def object_nullable_prop(self, value): - """Sets the object_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('object_nullable_prop', value) - - @property - def object_and_items_nullable_prop(self): - """Gets the object_and_items_nullable_prop of this NullableClass. # noqa: E501 - - Returns: - ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): The object_and_items_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__get_item('object_and_items_nullable_prop') - - @object_and_items_nullable_prop.setter - def object_and_items_nullable_prop(self, value): - """Sets the object_and_items_nullable_prop of this NullableClass. # noqa: E501 - """ - return self.__set_item('object_and_items_nullable_prop', value) - - @property - def object_items_nullable(self): - """Gets the object_items_nullable of this NullableClass. # noqa: E501 - - Returns: - ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The object_items_nullable of this NullableClass. # noqa: E501 - """ - return self.__get_item('object_items_nullable') - - @object_items_nullable.setter - def object_items_nullable(self, value): - """Sets the object_items_nullable of this NullableClass. # noqa: E501 - """ - return self.__set_item('object_items_nullable', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NullableClass): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py deleted file mode 100644 index 0761b3d3e323..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class NumberOnly(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'just_number': 'JustNumber' # noqa: E501 - } - - openapi_types = { - 'just_number': (float,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """NumberOnly - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - just_number (float): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def just_number(self): - """Gets the just_number of this NumberOnly. # noqa: E501 - - Returns: - (float): The just_number of this NumberOnly. # noqa: E501 - """ - return self.__get_item('just_number') - - @just_number.setter - def just_number(self, value): - """Sets the just_number of this NumberOnly. # noqa: E501 - """ - return self.__set_item('just_number', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NumberOnly): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py deleted file mode 100644 index 64c84902aba5..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py +++ /dev/null @@ -1,331 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Order(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - attribute_map = { - 'id': 'id', # noqa: E501 - 'pet_id': 'petId', # noqa: E501 - 'quantity': 'quantity', # noqa: E501 - 'ship_date': 'shipDate', # noqa: E501 - 'status': 'status', # noqa: E501 - 'complete': 'complete' # noqa: E501 - } - - openapi_types = { - 'id': (int,), # noqa: E501 - 'pet_id': (int,), # noqa: E501 - 'quantity': (int,), # noqa: E501 - 'ship_date': (datetime,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'complete': (bool,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Order - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - id (int): [optional] # noqa: E501 - pet_id (int): [optional] # noqa: E501 - quantity (int): [optional] # noqa: E501 - ship_date (datetime): [optional] # noqa: E501 - status (str): Order Status. [optional] # noqa: E501 - complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def id(self): - """Gets the id of this Order. # noqa: E501 - - Returns: - (int): The id of this Order. # noqa: E501 - """ - return self.__get_item('id') - - @id.setter - def id(self, value): - """Sets the id of this Order. # noqa: E501 - """ - return self.__set_item('id', value) - - @property - def pet_id(self): - """Gets the pet_id of this Order. # noqa: E501 - - Returns: - (int): The pet_id of this Order. # noqa: E501 - """ - return self.__get_item('pet_id') - - @pet_id.setter - def pet_id(self, value): - """Sets the pet_id of this Order. # noqa: E501 - """ - return self.__set_item('pet_id', value) - - @property - def quantity(self): - """Gets the quantity of this Order. # noqa: E501 - - Returns: - (int): The quantity of this Order. # noqa: E501 - """ - return self.__get_item('quantity') - - @quantity.setter - def quantity(self, value): - """Sets the quantity of this Order. # noqa: E501 - """ - return self.__set_item('quantity', value) - - @property - def ship_date(self): - """Gets the ship_date of this Order. # noqa: E501 - - Returns: - (datetime): The ship_date of this Order. # noqa: E501 - """ - return self.__get_item('ship_date') - - @ship_date.setter - def ship_date(self, value): - """Sets the ship_date of this Order. # noqa: E501 - """ - return self.__set_item('ship_date', value) - - @property - def status(self): - """Gets the status of this Order. # noqa: E501 - Order Status # noqa: E501 - - Returns: - (str): The status of this Order. # noqa: E501 - """ - return self.__get_item('status') - - @status.setter - def status(self, value): - """Sets the status of this Order. # noqa: E501 - Order Status # noqa: E501 - """ - return self.__set_item('status', value) - - @property - def complete(self): - """Gets the complete of this Order. # noqa: E501 - - Returns: - (bool): The complete of this Order. # noqa: E501 - """ - return self.__get_item('complete') - - @complete.setter - def complete(self, value): - """Sets the complete of this Order. # noqa: E501 - """ - return self.__set_item('complete', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Order): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py deleted file mode 100644 index ac5364799dbc..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ /dev/null @@ -1,270 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class OuterComposite(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'my_number': 'my_number', # noqa: E501 - 'my_string': 'my_string', # noqa: E501 - 'my_boolean': 'my_boolean' # noqa: E501 - } - - openapi_types = { - 'my_number': (float,), # noqa: E501 - 'my_string': (str,), # noqa: E501 - 'my_boolean': (bool,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """OuterComposite - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - my_number (float): [optional] # noqa: E501 - my_string (str): [optional] # noqa: E501 - my_boolean (bool): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def my_number(self): - """Gets the my_number of this OuterComposite. # noqa: E501 - - Returns: - (float): The my_number of this OuterComposite. # noqa: E501 - """ - return self.__get_item('my_number') - - @my_number.setter - def my_number(self, value): - """Sets the my_number of this OuterComposite. # noqa: E501 - """ - return self.__set_item('my_number', value) - - @property - def my_string(self): - """Gets the my_string of this OuterComposite. # noqa: E501 - - Returns: - (str): The my_string of this OuterComposite. # noqa: E501 - """ - return self.__get_item('my_string') - - @my_string.setter - def my_string(self, value): - """Sets the my_string of this OuterComposite. # noqa: E501 - """ - return self.__set_item('my_string', value) - - @property - def my_boolean(self): - """Gets the my_boolean of this OuterComposite. # noqa: E501 - - Returns: - (bool): The my_boolean of this OuterComposite. # noqa: E501 - """ - return self.__get_item('my_boolean') - - @my_boolean.setter - def my_boolean(self, value): - """Sets the my_boolean of this OuterComposite. # noqa: E501 - """ - return self.__set_item('my_boolean', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterComposite): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py deleted file mode 100644 index 06f998d1e541..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py +++ /dev/null @@ -1,227 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class OuterEnum(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'None': None, - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - openapi_types = { - 'value': (str, none_type,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """OuterEnum - a model defined in OpenAPI - - Args: - value (str, none_type): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('value', value) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def value(self): - """Gets the value of this OuterEnum. # noqa: E501 - - Returns: - (str, none_type): The value of this OuterEnum. # noqa: E501 - """ - return self.__get_item('value') - - @value.setter - def value(self, value): - """Sets the value of this OuterEnum. # noqa: E501 - """ - return self.__set_item('value', value) - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnum): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py deleted file mode 100644 index c867f7048565..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py +++ /dev/null @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class OuterEnumDefaultValue(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - 'PLACED': "placed", - 'APPROVED': "approved", - 'DELIVERED': "delivered", - }, - } - - openapi_types = { - 'value': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, value='placed', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """OuterEnumDefaultValue - a model defined in OpenAPI - - Args: - - Keyword Args: - value (str): defaults to 'placed', must be one of ['placed'] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('value', value) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def value(self): - """Gets the value of this OuterEnumDefaultValue. # noqa: E501 - - Returns: - (str): The value of this OuterEnumDefaultValue. # noqa: E501 - """ - return self.__get_item('value') - - @value.setter - def value(self, value): - """Sets the value of this OuterEnumDefaultValue. # noqa: E501 - """ - return self.__set_item('value', value) - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnumDefaultValue): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py deleted file mode 100644 index b4faf008cc33..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py +++ /dev/null @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class OuterEnumInteger(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '0': 0, - '1': 1, - '2': 2, - }, - } - - openapi_types = { - 'value': (int,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """OuterEnumInteger - a model defined in OpenAPI - - Args: - value (int): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('value', value) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def value(self): - """Gets the value of this OuterEnumInteger. # noqa: E501 - - Returns: - (int): The value of this OuterEnumInteger. # noqa: E501 - """ - return self.__get_item('value') - - @value.setter - def value(self, value): - """Sets the value of this OuterEnumInteger. # noqa: E501 - """ - return self.__set_item('value', value) - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnumInteger): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py deleted file mode 100644 index 3dafc4738ec8..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py +++ /dev/null @@ -1,226 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class OuterEnumIntegerDefaultValue(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('value',): { - '0': 0, - '1': 1, - '2': 2, - }, - } - - openapi_types = { - 'value': (int,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """OuterEnumIntegerDefaultValue - a model defined in OpenAPI - - Args: - - Keyword Args: - value (int): defaults to 0, must be one of [0] # noqa: E501 - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('value', value) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def value(self): - """Gets the value of this OuterEnumIntegerDefaultValue. # noqa: E501 - - Returns: - (int): The value of this OuterEnumIntegerDefaultValue. # noqa: E501 - """ - return self.__get_item('value') - - @value.setter - def value(self, value): - """Sets the value of this OuterEnumIntegerDefaultValue. # noqa: E501 - """ - return self.__set_item('value', value) - - def to_str(self): - """Returns the string representation of the model""" - return str(self.value) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, OuterEnumIntegerDefaultValue): - return False - - this_val = self._data_store['value'] - that_val = other._data_store['value'] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py deleted file mode 100644 index 3abfdfba760c..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py +++ /dev/null @@ -1,336 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) -from petstore_api.models.category import Category -from petstore_api.models.tag import Tag - - -class Pet(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - ('status',): { - 'AVAILABLE': "available", - 'PENDING': "pending", - 'SOLD': "sold", - }, - } - - attribute_map = { - 'id': 'id', # noqa: E501 - 'category': 'category', # noqa: E501 - 'name': 'name', # noqa: E501 - 'photo_urls': 'photoUrls', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'status': 'status' # noqa: E501 - } - - openapi_types = { - 'id': (int,), # noqa: E501 - 'category': (Category,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'photo_urls': ([str],), # noqa: E501 - 'tags': ([Tag],), # noqa: E501 - 'status': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Pet - a model defined in OpenAPI - - Args: - name (str): - photo_urls ([str]): - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - id (int): [optional] # noqa: E501 - category (Category): [optional] # noqa: E501 - tags ([Tag]): [optional] # noqa: E501 - status (str): pet status in the store. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - self.__set_item('name', name) - self.__set_item('photo_urls', photo_urls) - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def id(self): - """Gets the id of this Pet. # noqa: E501 - - Returns: - (int): The id of this Pet. # noqa: E501 - """ - return self.__get_item('id') - - @id.setter - def id(self, value): - """Sets the id of this Pet. # noqa: E501 - """ - return self.__set_item('id', value) - - @property - def category(self): - """Gets the category of this Pet. # noqa: E501 - - Returns: - (Category): The category of this Pet. # noqa: E501 - """ - return self.__get_item('category') - - @category.setter - def category(self, value): - """Sets the category of this Pet. # noqa: E501 - """ - return self.__set_item('category', value) - - @property - def name(self): - """Gets the name of this Pet. # noqa: E501 - - Returns: - (str): The name of this Pet. # noqa: E501 - """ - return self.__get_item('name') - - @name.setter - def name(self, value): - """Sets the name of this Pet. # noqa: E501 - """ - return self.__set_item('name', value) - - @property - def photo_urls(self): - """Gets the photo_urls of this Pet. # noqa: E501 - - Returns: - ([str]): The photo_urls of this Pet. # noqa: E501 - """ - return self.__get_item('photo_urls') - - @photo_urls.setter - def photo_urls(self, value): - """Sets the photo_urls of this Pet. # noqa: E501 - """ - return self.__set_item('photo_urls', value) - - @property - def tags(self): - """Gets the tags of this Pet. # noqa: E501 - - Returns: - ([Tag]): The tags of this Pet. # noqa: E501 - """ - return self.__get_item('tags') - - @tags.setter - def tags(self, value): - """Sets the tags of this Pet. # noqa: E501 - """ - return self.__set_item('tags', value) - - @property - def status(self): - """Gets the status of this Pet. # noqa: E501 - pet status in the store # noqa: E501 - - Returns: - (str): The status of this Pet. # noqa: E501 - """ - return self.__get_item('status') - - @status.setter - def status(self, value): - """Sets the status of this Pet. # noqa: E501 - pet status in the store # noqa: E501 - """ - return self.__set_item('status', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Pet): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py deleted file mode 100644 index 848fbccfa913..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py +++ /dev/null @@ -1,252 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class ReadOnlyFirst(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'bar': 'bar', # noqa: E501 - 'baz': 'baz' # noqa: E501 - } - - openapi_types = { - 'bar': (str,), # noqa: E501 - 'baz': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """ReadOnlyFirst - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - bar (str): [optional] # noqa: E501 - baz (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def bar(self): - """Gets the bar of this ReadOnlyFirst. # noqa: E501 - - Returns: - (str): The bar of this ReadOnlyFirst. # noqa: E501 - """ - return self.__get_item('bar') - - @bar.setter - def bar(self, value): - """Sets the bar of this ReadOnlyFirst. # noqa: E501 - """ - return self.__set_item('bar', value) - - @property - def baz(self): - """Gets the baz of this ReadOnlyFirst. # noqa: E501 - - Returns: - (str): The baz of this ReadOnlyFirst. # noqa: E501 - """ - return self.__get_item('baz') - - @baz.setter - def baz(self, value): - """Sets the baz of this ReadOnlyFirst. # noqa: E501 - """ - return self.__set_item('baz', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ReadOnlyFirst): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py deleted file mode 100644 index 83810bdb8941..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class SpecialModelName(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'special_property_name': '$special[property.name]' # noqa: E501 - } - - openapi_types = { - 'special_property_name': (int,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """SpecialModelName - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - special_property_name (int): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def special_property_name(self): - """Gets the special_property_name of this SpecialModelName. # noqa: E501 - - Returns: - (int): The special_property_name of this SpecialModelName. # noqa: E501 - """ - return self.__get_item('special_property_name') - - @special_property_name.setter - def special_property_name(self, value): - """Sets the special_property_name of this SpecialModelName. # noqa: E501 - """ - return self.__set_item('special_property_name', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SpecialModelName): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py deleted file mode 100644 index 1d10f9a8d7ed..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py +++ /dev/null @@ -1,216 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class StringBooleanMap(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - } - - openapi_types = { - } - - validations = { - } - - additional_properties_type = (bool,) # noqa: E501 - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """StringBooleanMap - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, StringBooleanMap): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py deleted file mode 100644 index 4e1fd5ef077e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py +++ /dev/null @@ -1,252 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class Tag(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'id': 'id', # noqa: E501 - 'name': 'name' # noqa: E501 - } - - openapi_types = { - 'id': (int,), # noqa: E501 - 'name': (str,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """Tag - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - id (int): [optional] # noqa: E501 - name (str): [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def id(self): - """Gets the id of this Tag. # noqa: E501 - - Returns: - (int): The id of this Tag. # noqa: E501 - """ - return self.__get_item('id') - - @id.setter - def id(self, value): - """Sets the id of this Tag. # noqa: E501 - """ - return self.__set_item('id', value) - - @property - def name(self): - """Gets the name of this Tag. # noqa: E501 - - Returns: - (str): The name of this Tag. # noqa: E501 - """ - return self.__get_item('name') - - @name.setter - def name(self, value): - """Sets the name of this Tag. # noqa: E501 - """ - return self.__set_item('name', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Tag): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py deleted file mode 100644 index 6d4d4539a849..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py +++ /dev/null @@ -1,362 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -import pprint # noqa: F401 -import re # noqa: F401 - -import six # noqa: F401 - -from petstore_api.exceptions import ( # noqa: F401 - ApiKeyError, - ApiTypeError, - ApiValueError, -) -from petstore_api.model_utils import ( # noqa: F401 - ModelNormal, - ModelSimple, - check_allowed_values, - check_validations, - date, - datetime, - file_type, - get_simple_class, - int, - model_to_dict, - none_type, - str, - type_error_message, - validate_and_convert_types -) - - -class User(ModelNormal): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - - Attributes: - allowed_values (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - with a capitalized key describing the allowed value and an allowed - value. These dicts store the allowed enum values. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - discriminator_value_class_map (dict): A dict to go from the discriminator - variable value to the discriminator class name. - openapi_types (dict): The key is attribute name - and the value is attribute type. - validations (dict): The key is the tuple path to the attribute - and the for var_name this is (var_name,). The value is a dict - that stores validations for max_length, min_length, max_items, - min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, - inclusive_minimum, and regex. - additional_properties_type (tuple): A tuple of classes accepted - as additional properties values. - """ - - allowed_values = { - } - - attribute_map = { - 'id': 'id', # noqa: E501 - 'username': 'username', # noqa: E501 - 'first_name': 'firstName', # noqa: E501 - 'last_name': 'lastName', # noqa: E501 - 'email': 'email', # noqa: E501 - 'password': 'password', # noqa: E501 - 'phone': 'phone', # noqa: E501 - 'user_status': 'userStatus' # noqa: E501 - } - - openapi_types = { - 'id': (int,), # noqa: E501 - 'username': (str,), # noqa: E501 - 'first_name': (str,), # noqa: E501 - 'last_name': (str,), # noqa: E501 - 'email': (str,), # noqa: E501 - 'password': (str,), # noqa: E501 - 'phone': (str,), # noqa: E501 - 'user_status': (int,), # noqa: E501 - } - - validations = { - } - - additional_properties_type = None - - discriminator = None - - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 - """User - a model defined in OpenAPI - - - Keyword Args: - _check_type (bool): if True, values for parameters in openapi_types - will be type checked and a TypeError will be - raised if the wrong type is input. - Defaults to True - _path_to_item (tuple/list): This is a list of keys or values to - drill down to the model in received_data - when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) - _configuration (Configuration): the instance to use when - deserializing a file_type parameter. - If passed, type conversion is attempted - If omitted no type conversion is done. - id (int): [optional] # noqa: E501 - username (str): [optional] # noqa: E501 - first_name (str): [optional] # noqa: E501 - last_name (str): [optional] # noqa: E501 - email (str): [optional] # noqa: E501 - password (str): [optional] # noqa: E501 - phone (str): [optional] # noqa: E501 - user_status (int): User Status. [optional] # noqa: E501 - """ - self._data_store = {} - self._check_type = _check_type - self._from_server = _from_server - self._path_to_item = _path_to_item - self._configuration = _configuration - - for var_name, var_value in six.iteritems(kwargs): - self.__set_item(var_name, var_value) - - def __set_item(self, name, value): - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - - if name in self.openapi_types: - required_types_mixed = self.openapi_types[name] - elif self.additional_properties_type is None: - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - path_to_item - ) - elif self.additional_properties_type is not None: - required_types_mixed = self.additional_properties_type - - if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) - - if self._check_type: - value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), - value - ) - self._data_store[name] = value - - def __get_item(self, name): - if name in self._data_store: - return self._data_store[name] - - path_to_item = [] - if self._path_to_item: - path_to_item.extend(self._path_to_item) - path_to_item.append(name) - raise ApiKeyError( - "{0} has no key '{1}'".format(type(self).__name__, name), - [name] - ) - - def __setitem__(self, name, value): - """this allows us to set values with instance[field_name] = val""" - self.__set_item(name, value) - - def __getitem__(self, name): - """this allows us to get a value with val = instance[field_name]""" - return self.__get_item(name) - - @property - def id(self): - """Gets the id of this User. # noqa: E501 - - Returns: - (int): The id of this User. # noqa: E501 - """ - return self.__get_item('id') - - @id.setter - def id(self, value): - """Sets the id of this User. # noqa: E501 - """ - return self.__set_item('id', value) - - @property - def username(self): - """Gets the username of this User. # noqa: E501 - - Returns: - (str): The username of this User. # noqa: E501 - """ - return self.__get_item('username') - - @username.setter - def username(self, value): - """Sets the username of this User. # noqa: E501 - """ - return self.__set_item('username', value) - - @property - def first_name(self): - """Gets the first_name of this User. # noqa: E501 - - Returns: - (str): The first_name of this User. # noqa: E501 - """ - return self.__get_item('first_name') - - @first_name.setter - def first_name(self, value): - """Sets the first_name of this User. # noqa: E501 - """ - return self.__set_item('first_name', value) - - @property - def last_name(self): - """Gets the last_name of this User. # noqa: E501 - - Returns: - (str): The last_name of this User. # noqa: E501 - """ - return self.__get_item('last_name') - - @last_name.setter - def last_name(self, value): - """Sets the last_name of this User. # noqa: E501 - """ - return self.__set_item('last_name', value) - - @property - def email(self): - """Gets the email of this User. # noqa: E501 - - Returns: - (str): The email of this User. # noqa: E501 - """ - return self.__get_item('email') - - @email.setter - def email(self, value): - """Sets the email of this User. # noqa: E501 - """ - return self.__set_item('email', value) - - @property - def password(self): - """Gets the password of this User. # noqa: E501 - - Returns: - (str): The password of this User. # noqa: E501 - """ - return self.__get_item('password') - - @password.setter - def password(self, value): - """Sets the password of this User. # noqa: E501 - """ - return self.__set_item('password', value) - - @property - def phone(self): - """Gets the phone of this User. # noqa: E501 - - Returns: - (str): The phone of this User. # noqa: E501 - """ - return self.__get_item('phone') - - @phone.setter - def phone(self, value): - """Sets the phone of this User. # noqa: E501 - """ - return self.__set_item('phone', value) - - @property - def user_status(self): - """Gets the user_status of this User. # noqa: E501 - User Status # noqa: E501 - - Returns: - (int): The user_status of this User. # noqa: E501 - """ - return self.__get_item('user_status') - - @user_status.setter - def user_status(self, value): - """Sets the user_status of this User. # noqa: E501 - User Status # noqa: E501 - """ - return self.__set_item('user_status', value) - - def to_dict(self): - """Returns the model properties as a dict""" - return model_to_dict(self, serialize=False) - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, User): - return False - - if not set(self._data_store.keys()) == set(other._data_store.keys()): - return False - for _var_name, this_val in six.iteritems(self._data_store): - that_val = other._data_store[_var_name] - types = set() - types.add(this_val.__class__) - types.add(that_val.__class__) - vals_equal = this_val == that_val - if (not six.PY3 and - len(types) == 2 and unicode in types): # noqa: F821 - vals_equal = ( - this_val.encode('utf-8') == that_val.encode('utf-8') - ) - if not vals_equal: - return False - return True - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py deleted file mode 100644 index 7ed815b8a187..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py +++ /dev/null @@ -1,296 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import io -import json -import logging -import re -import ssl - -import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode -import urllib3 - -from petstore_api.exceptions import ApiException, ApiValueError - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) - - -class RESTClientObject(object): - - def __init__(self, configuration, pools_size=4, maxsize=None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt deleted file mode 100644 index eb358efd5bd3..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -certifi >= 14.05.14 -future; python_version<="2.7" -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py deleted file mode 100644 index b896f2ff0b68..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from setuptools import setup, find_packages # noqa: H301 - -NAME = "petstore-api" -VERSION = "1.0.0" -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] -REQUIRES.append("pem>=19.3.0") -REQUIRES.append("pycryptodome>=3.9.0") -EXTRAS = {':python_version <= "2.7"': ['future']} - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author="OpenAPI Generator community", - author_email="team@openapitools.org", - url="", - keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], - install_requires=REQUIRES, - extras_require=EXTRAS, - packages=find_packages(exclude=["test", "tests"]), - include_package_data=True, - license="Apache-2.0", - long_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: \" \\ # noqa: E501 - """ -) diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt deleted file mode 100644 index 5816b8749532..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -mock; python_version<="2.7" - diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/petstore/python-experimental/test/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py deleted file mode 100644 index af455282e558..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.additional_properties_class import AdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAdditionalPropertiesClass(unittest.TestCase): - """AdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAdditionalPropertiesClass(self): - """Test AdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py deleted file mode 100644 index 36e8afaaa7dc..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.animal import Animal # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnimal(unittest.TestCase): - """Animal unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAnimal(self): - """Test Animal""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.animal.Animal() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py deleted file mode 100644 index d95798cfc5a4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestAnotherFakeApi(unittest.TestCase): - """AnotherFakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_call_123_test_special_tags(self): - """Test case for call_123_test_special_tags - - To test special tags # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py deleted file mode 100644 index 5032e2a92160..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.api_response import ApiResponse # noqa: E501 -from petstore_api.rest import ApiException - - -class TestApiResponse(unittest.TestCase): - """ApiResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testApiResponse(self): - """Test ApiResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.api_response.ApiResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py deleted file mode 100644 index c938bf374df7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfArrayOfNumberOnly(unittest.TestCase): - """ArrayOfArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfArrayOfNumberOnly(self): - """Test ArrayOfArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_array_of_number_only.ArrayOfArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py deleted file mode 100644 index 8148b493c1bc..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_of_number_only import ArrayOfNumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayOfNumberOnly(unittest.TestCase): - """ArrayOfNumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayOfNumberOnly(self): - """Test ArrayOfNumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_of_number_only.ArrayOfNumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py deleted file mode 100644 index a463e28234e8..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.array_test import ArrayTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestArrayTest(unittest.TestCase): - """ArrayTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testArrayTest(self): - """Test ArrayTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.array_test.ArrayTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py deleted file mode 100644 index d8bba72f3d1b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.capitalization import Capitalization # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCapitalization(unittest.TestCase): - """Capitalization unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCapitalization(self): - """Test Capitalization""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.capitalization.Capitalization() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py deleted file mode 100644 index 06008bf4aaad..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.cat import Cat # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCat(unittest.TestCase): - """Cat unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCat(self): - """Test Cat""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat.Cat() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py deleted file mode 100644 index 496e348e1d54..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.cat_all_of import CatAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCatAllOf(unittest.TestCase): - """CatAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCatAllOf(self): - """Test CatAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.cat_all_of.CatAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py deleted file mode 100644 index 257ef19234ac..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_category.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.category import Category # noqa: E501 -from petstore_api.rest import ApiException - - -class TestCategory(unittest.TestCase): - """Category unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCategory(self): - """Test Category""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.category.Category() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py deleted file mode 100644 index 6fa92ec9070f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.class_model import ClassModel # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClassModel(unittest.TestCase): - """ClassModel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassModel(self): - """Test ClassModel""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.class_model.ClassModel() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py deleted file mode 100644 index d7425ab273e7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_client.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.client import Client # noqa: E501 -from petstore_api.rest import ApiException - - -class TestClient(unittest.TestCase): - """Client unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClient(self): - """Test Client""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.client.Client() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py deleted file mode 100644 index 50e7c57bd0bf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.default_api import DefaultApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDefaultApi(unittest.TestCase): - """DefaultApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501 - - def tearDown(self): - pass - - def test_foo_get(self): - """Test case for foo_get - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py deleted file mode 100644 index 56e58d709f0d..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog import Dog # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDog(unittest.TestCase): - """Dog unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDog(self): - """Test Dog""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog.Dog() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py deleted file mode 100644 index 8f83f6c7192b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.dog_all_of import DogAllOf # noqa: E501 -from petstore_api.rest import ApiException - - -class TestDogAllOf(unittest.TestCase): - """DogAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testDogAllOf(self): - """Test DogAllOf""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.dog_all_of.DogAllOf() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py deleted file mode 100644 index 02f5019ec643..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_arrays import EnumArrays # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumArrays(unittest.TestCase): - """EnumArrays unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumArrays(self): - """Test EnumArrays""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_arrays.EnumArrays() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py deleted file mode 100644 index 87a14751a178..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_class import EnumClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumClass(unittest.TestCase): - """EnumClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumClass(self): - """Test EnumClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_class.EnumClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py deleted file mode 100644 index be0bd7859b39..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.enum_test import EnumTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestEnumTest(unittest.TestCase): - """EnumTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEnumTest(self): - """Test EnumTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.enum_test.EnumTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py deleted file mode 100644 index 581d1499eedf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_api import FakeApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeApi(unittest.TestCase): - """FakeApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 - - def tearDown(self): - pass - - def test_fake_health_get(self): - """Test case for fake_health_get - - Health check endpoint # noqa: E501 - """ - pass - - def test_fake_outer_boolean_serialize(self): - """Test case for fake_outer_boolean_serialize - - """ - pass - - def test_fake_outer_composite_serialize(self): - """Test case for fake_outer_composite_serialize - - """ - pass - - def test_fake_outer_number_serialize(self): - """Test case for fake_outer_number_serialize - - """ - pass - - def test_fake_outer_string_serialize(self): - """Test case for fake_outer_string_serialize - - """ - pass - - def test_test_body_with_file_schema(self): - """Test case for test_body_with_file_schema - - """ - pass - - def test_test_body_with_query_params(self): - """Test case for test_body_with_query_params - - """ - pass - - def test_test_client_model(self): - """Test case for test_client_model - - To test \"client\" model # noqa: E501 - """ - pass - - def test_test_endpoint_parameters(self): - """Test case for test_endpoint_parameters - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 - """ - pass - - def test_test_enum_parameters(self): - """Test case for test_enum_parameters - - To test enum parameters # noqa: E501 - """ - pass - - def test_test_group_parameters(self): - """Test case for test_group_parameters - - Fake endpoint to test group parameters (optional) # noqa: E501 - """ - pass - - def test_test_inline_additional_properties(self): - """Test case for test_inline_additional_properties - - test inline additionalProperties # noqa: E501 - """ - pass - - def test_test_json_form_data(self): - """Test case for test_json_form_data - - test json serialization of form data # noqa: E501 - """ - pass - - def test_test_query_parameter_collection_format(self): - """Test case for test_query_parameter_collection_format - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py deleted file mode 100644 index f54e0d06644f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFakeClassnameTags123Api(unittest.TestCase): - """FakeClassnameTags123Api unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 - - def tearDown(self): - pass - - def test_test_classname(self): - """Test case for test_classname - - To test class name in snake case # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py deleted file mode 100644 index 6c30ca900683..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.file import File # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFile(unittest.TestCase): - """File unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFile(self): - """Test File""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file.File() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py deleted file mode 100644 index 30ba7dffbfca..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.file_schema_test_class import FileSchemaTestClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFileSchemaTestClass(unittest.TestCase): - """FileSchemaTestClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFileSchemaTestClass(self): - """Test FileSchemaTestClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.file_schema_test_class.FileSchemaTestClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py deleted file mode 100644 index 1c4d0794d85e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.foo import Foo # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFoo(unittest.TestCase): - """Foo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFoo(self): - """Test Foo""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.foo.Foo() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py deleted file mode 100644 index b7ddece031f0..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.format_test import FormatTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestFormatTest(unittest.TestCase): - """FormatTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFormatTest(self): - """Test FormatTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.format_test.FormatTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py deleted file mode 100644 index 308ad18085d6..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.has_only_read_only import HasOnlyReadOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestHasOnlyReadOnly(unittest.TestCase): - """HasOnlyReadOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHasOnlyReadOnly(self): - """Test HasOnlyReadOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.has_only_read_only.HasOnlyReadOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py deleted file mode 100644 index 7fcee8775e07..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.health_check_result import HealthCheckResult # noqa: E501 -from petstore_api.rest import ApiException - - -class TestHealthCheckResult(unittest.TestCase): - """HealthCheckResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHealthCheckResult(self): - """Test HealthCheckResult""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.health_check_result.HealthCheckResult() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py deleted file mode 100644 index 5247a9683ba8..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.inline_object import InlineObject # noqa: E501 -from petstore_api.rest import ApiException - - -class TestInlineObject(unittest.TestCase): - """InlineObject unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineObject(self): - """Test InlineObject""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.inline_object.InlineObject() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py deleted file mode 100644 index 79045ee8624b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.inline_object1 import InlineObject1 # noqa: E501 -from petstore_api.rest import ApiException - - -class TestInlineObject1(unittest.TestCase): - """InlineObject1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineObject1(self): - """Test InlineObject1""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.inline_object1.InlineObject1() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py deleted file mode 100644 index cf25ce661569..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.inline_object2 import InlineObject2 # noqa: E501 -from petstore_api.rest import ApiException - - -class TestInlineObject2(unittest.TestCase): - """InlineObject2 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineObject2(self): - """Test InlineObject2""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.inline_object2.InlineObject2() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py deleted file mode 100644 index b48bc0c7d1f4..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.inline_object3 import InlineObject3 # noqa: E501 -from petstore_api.rest import ApiException - - -class TestInlineObject3(unittest.TestCase): - """InlineObject3 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineObject3(self): - """Test InlineObject3""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.inline_object3.InlineObject3() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py deleted file mode 100644 index 4db27423b858..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.inline_object4 import InlineObject4 # noqa: E501 -from petstore_api.rest import ApiException - - -class TestInlineObject4(unittest.TestCase): - """InlineObject4 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineObject4(self): - """Test InlineObject4""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.inline_object4.InlineObject4() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py deleted file mode 100644 index 229bada2af53..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.inline_object5 import InlineObject5 # noqa: E501 -from petstore_api.rest import ApiException - - -class TestInlineObject5(unittest.TestCase): - """InlineObject5 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineObject5(self): - """Test InlineObject5""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.inline_object5.InlineObject5() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py deleted file mode 100644 index 2f77f14b9f84..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.inline_response_default import InlineResponseDefault # noqa: E501 -from petstore_api.rest import ApiException - - -class TestInlineResponseDefault(unittest.TestCase): - """InlineResponseDefault unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponseDefault(self): - """Test InlineResponseDefault""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.inline_response_default.InlineResponseDefault() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py deleted file mode 100644 index dc1ac9d82e50..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.list import List # noqa: E501 -from petstore_api.rest import ApiException - - -class TestList(unittest.TestCase): - """List unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testList(self): - """Test List""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.list.List() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py deleted file mode 100644 index e34d75cab4e3..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.map_test import MapTest # noqa: E501 -from petstore_api.rest import ApiException - - -class TestMapTest(unittest.TestCase): - """MapTest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMapTest(self): - """Test MapTest""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.map_test.MapTest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py deleted file mode 100644 index 294ef15f1572..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): - """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMixedPropertiesAndAdditionalPropertiesClass(self): - """Test MixedPropertiesAndAdditionalPropertiesClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py deleted file mode 100644 index 5c98c9b3ee14..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model200_response import Model200Response # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModel200Response(unittest.TestCase): - """Model200Response unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModel200Response(self): - """Test Model200Response""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model200_response.Model200Response() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py deleted file mode 100644 index 7dcfacc1fbb8..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.model_return import ModelReturn # noqa: E501 -from petstore_api.rest import ApiException - - -class TestModelReturn(unittest.TestCase): - """ModelReturn unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testModelReturn(self): - """Test ModelReturn""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.model_return.ModelReturn() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py deleted file mode 100644 index f421e0a7ebe6..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.name import Name # noqa: E501 -from petstore_api.rest import ApiException - - -class TestName(unittest.TestCase): - """Name unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testName(self): - """Test Name""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.name.Name() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py deleted file mode 100644 index eaa1aace505a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.nullable_class import NullableClass # noqa: E501 -from petstore_api.rest import ApiException - - -class TestNullableClass(unittest.TestCase): - """NullableClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNullableClass(self): - """Test NullableClass""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.nullable_class.NullableClass() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py deleted file mode 100644 index 43d5df2ac75f..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.number_only import NumberOnly # noqa: E501 -from petstore_api.rest import ApiException - - -class TestNumberOnly(unittest.TestCase): - """NumberOnly unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testNumberOnly(self): - """Test NumberOnly""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.number_only.NumberOnly() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py deleted file mode 100644 index f9bcbc3cab85..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_order.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.order import Order # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrder(self): - """Test Order""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.order.Order() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py deleted file mode 100644 index af3b218592c5..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_composite import OuterComposite # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterComposite(unittest.TestCase): - """OuterComposite unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterComposite(self): - """Test OuterComposite""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_composite.OuterComposite() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py deleted file mode 100644 index bf6441407505..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_enum import OuterEnum # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterEnum(unittest.TestCase): - """OuterEnum unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnum(self): - """Test OuterEnum""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum.OuterEnum() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py deleted file mode 100644 index cb3c112b0ec3..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterEnumDefaultValue(unittest.TestCase): - """OuterEnumDefaultValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnumDefaultValue(self): - """Test OuterEnumDefaultValue""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum_default_value.OuterEnumDefaultValue() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py deleted file mode 100644 index 34b0d1cc0250..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_enum_integer import OuterEnumInteger # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterEnumInteger(unittest.TestCase): - """OuterEnumInteger unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnumInteger(self): - """Test OuterEnumInteger""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum_integer.OuterEnumInteger() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py deleted file mode 100644 index 53158d0ce2e0..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue # noqa: E501 -from petstore_api.rest import ApiException - - -class TestOuterEnumIntegerDefaultValue(unittest.TestCase): - """OuterEnumIntegerDefaultValue unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOuterEnumIntegerDefaultValue(self): - """Test OuterEnumIntegerDefaultValue""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.outer_enum_integer_default_value.OuterEnumIntegerDefaultValue() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py deleted file mode 100644 index b05f6aad6a8a..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.pet import Pet # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPet(unittest.TestCase): - """Pet unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPet(self): - """Test Pet""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.pet.Pet() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py deleted file mode 100644 index 77665df879f1..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.pet_api import PetApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestPetApi(unittest.TestCase): - """PetApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 - - def tearDown(self): - pass - - def test_add_pet(self): - """Test case for add_pet - - Add a new pet to the store # noqa: E501 - """ - pass - - def test_delete_pet(self): - """Test case for delete_pet - - Deletes a pet # noqa: E501 - """ - pass - - def test_find_pets_by_status(self): - """Test case for find_pets_by_status - - Finds Pets by status # noqa: E501 - """ - pass - - def test_find_pets_by_tags(self): - """Test case for find_pets_by_tags - - Finds Pets by tags # noqa: E501 - """ - pass - - def test_get_pet_by_id(self): - """Test case for get_pet_by_id - - Find pet by ID # noqa: E501 - """ - pass - - def test_update_pet(self): - """Test case for update_pet - - Update an existing pet # noqa: E501 - """ - pass - - def test_update_pet_with_form(self): - """Test case for update_pet_with_form - - Updates a pet in the store with form data # noqa: E501 - """ - pass - - def test_upload_file(self): - """Test case for upload_file - - uploads an image # noqa: E501 - """ - pass - - def test_upload_file_with_required_file(self): - """Test case for upload_file_with_required_file - - uploads an image (required) # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py deleted file mode 100644 index 9223d493aff0..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.read_only_first import ReadOnlyFirst # noqa: E501 -from petstore_api.rest import ApiException - - -class TestReadOnlyFirst(unittest.TestCase): - """ReadOnlyFirst unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReadOnlyFirst(self): - """Test ReadOnlyFirst""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.read_only_first.ReadOnlyFirst() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py deleted file mode 100644 index 5c9f30f71fec..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.special_model_name import SpecialModelName # noqa: E501 -from petstore_api.rest import ApiException - - -class TestSpecialModelName(unittest.TestCase): - """SpecialModelName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSpecialModelName(self): - """Test SpecialModelName""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.special_model_name.SpecialModelName() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py deleted file mode 100644 index 81848d24a67e..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.store_api import StoreApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestStoreApi(unittest.TestCase): - """StoreApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 - - def tearDown(self): - pass - - def test_delete_order(self): - """Test case for delete_order - - Delete purchase order by ID # noqa: E501 - """ - pass - - def test_get_inventory(self): - """Test case for get_inventory - - Returns pet inventories by status # noqa: E501 - """ - pass - - def test_get_order_by_id(self): - """Test case for get_order_by_id - - Find purchase order by ID # noqa: E501 - """ - pass - - def test_place_order(self): - """Test case for place_order - - Place an order for a pet # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py deleted file mode 100644 index 31c1ebeec5db..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.string_boolean_map import StringBooleanMap # noqa: E501 -from petstore_api.rest import ApiException - - -class TestStringBooleanMap(unittest.TestCase): - """StringBooleanMap unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testStringBooleanMap(self): - """Test StringBooleanMap""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.string_boolean_map.StringBooleanMap() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py deleted file mode 100644 index b0c8ef0c6816..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.tag import Tag # noqa: E501 -from petstore_api.rest import ApiException - - -class TestTag(unittest.TestCase): - """Tag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTag(self): - """Test Tag""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.tag.Tag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py deleted file mode 100644 index cb026e3edb5b..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.models.user import User # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUser(unittest.TestCase): - """User unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUser(self): - """Test User""" - # FIXME: construct object with mandatory attributes with example values - # model = petstore_api.models.user.User() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py deleted file mode 100644 index 6df730fba2b1..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - 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: \" \\ # noqa: E501 - - The version of the OpenAPI document: 1.0.0 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import petstore_api -from petstore_api.api.user_api import UserApi # noqa: E501 -from petstore_api.rest import ApiException - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self): - self.api = petstore_api.api.user_api.UserApi() # noqa: E501 - - def tearDown(self): - pass - - def test_create_user(self): - """Test case for create_user - - Create user # noqa: E501 - """ - pass - - def test_create_users_with_array_input(self): - """Test case for create_users_with_array_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_create_users_with_list_input(self): - """Test case for create_users_with_list_input - - Creates list of users with given input array # noqa: E501 - """ - pass - - def test_delete_user(self): - """Test case for delete_user - - Delete user # noqa: E501 - """ - pass - - def test_get_user_by_name(self): - """Test case for get_user_by_name - - Get user by user name # noqa: E501 - """ - pass - - def test_login_user(self): - """Test case for login_user - - Logs user into the system # noqa: E501 - """ - pass - - def test_logout_user(self): - """Test case for logout_user - - Logs out current logged in user session # noqa: E501 - """ - pass - - def test_update_user(self): - """Test case for update_user - - Updated user # noqa: E501 - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/tests/__init__.py b/samples/openapi3/client/petstore/python-experimental/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py b/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py deleted file mode 100644 index 51fb281e7bdf..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_api_client.py +++ /dev/null @@ -1,225 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" -Run the tests. -$ pip install nose (optional) -$ cd OpenAPIetstore-python -$ nosetests -v -""" - -import os -import time -import unittest -from dateutil.parser import parse -from Crypto.PublicKey import RSA, ECC - -import petstore_api -import petstore_api.configuration - -HOST = 'http://petstore.swagger.io/v2' - - -class ApiClientTests(unittest.TestCase): - - def setUp(self): - self.api_client = petstore_api.ApiClient() - - def test_http_signature(self): - """ Test HTTP signature authentication. - """ - header_params = { - 'test1': 'value1', - 'test2': 'value2', - 'Content-Type': 'application/json' - } - query_params = {'test2': 'value2'} - auth_settings = ['http_signature_test'] - - # Generate RSA key for test purpose - rsakey = RSA.generate(2048) - # Generate ECDSA key for test purpose - ecdsakey = ECC.generate(curve='p521') - #ecdsakey = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p) - - for privkey in [ rsakey, ecdsakey ]: - config = petstore_api.Configuration() - config.host = 'http://localhost/' - config.key_id = 'test-key' - config.private_key_path = None - config.signing_scheme = 'hs2019' - config.signed_headers = ['test1', 'Content-Type'] - config.private_key = privkey - if isinstance(privkey, RSA.RsaKey): - signing_algorithms = ['PKCS1-v1_5', 'PSS'] - elif isinstance(privkey, ECC.EccKey): - signing_algorithms = ['fips-186-3', 'deterministic-rfc6979'] - - for signing_algorithm in signing_algorithms: - config.signing_algorithm = signing_algorithm - - client = petstore_api.ApiClient(config) - - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings, - resource_path='/pet', method='POST', body='{ }') - self.assertTrue('Digest' in header_params) - self.assertTrue('Authorization' in header_params) - self.assertTrue('Date' in header_params) - self.assertTrue('Host' in header_params) - #for hdr_key, hdr_value in header_params.items(): - # print("HEADER: {0}={1}".format(hdr_key, hdr_value)) - - def test_configuration(self): - config = petstore_api.Configuration() - config.host = 'http://localhost/' - - # Test api_key authentication - config.api_key['api_key'] = '123456' - config.api_key_prefix['api_key'] = 'PREFIX' - config.username = 'test_username' - config.password = 'test_password' - - header_params = {'test1': 'value1'} - query_params = {'test2': 'value2'} - auth_settings = ['api_key', 'unknown'] - - client = petstore_api.ApiClient(config) - - # test prefix - self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) - - # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) - - # test api key auth - self.assertEqual(header_params['test1'], 'value1') - self.assertEqual(header_params['api_key'], 'PREFIX 123456') - self.assertEqual(query_params['test2'], 'value2') - - # test basic auth - self.assertEqual('test_username', client.configuration.username) - self.assertEqual('test_password', client.configuration.password) - - def test_select_header_accept(self): - accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/json', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['application/xml', 'application/json'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'application/json') - - accepts = ['text/plain', 'application/xml'] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, 'text/plain, application/xml') - - accepts = [] - accept = self.api_client.select_header_accept(accepts) - self.assertEqual(accept, None) - - def test_select_header_content_type(self): - content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/json', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['application/xml', 'application/json'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - content_types = ['text/plain', 'application/xml'] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'text/plain') - - content_types = [] - content_type = self.api_client.select_header_content_type(content_types) - self.assertEqual(content_type, 'application/json') - - def test_sanitize_for_serialization(self): - # None - data = None - result = self.api_client.sanitize_for_serialization(None) - self.assertEqual(result, data) - - # str - data = "test string" - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # int - data = 1 - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # bool - data = True - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # date - data = parse("1997-07-16").date() # date - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16") - - # datetime - data = parse("1997-07-16T19:20:30.45+01:00") # datetime - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") - - # list - data = [1] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # dict - data = {"test key": "test value"} - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, data) - - # model - pet_dict = {"id": 1, "name": "monkey", - "category": {"id": 1, "name": "test category"}, - "tags": [{"id": 1, "name": "test tag1"}, - {"id": 2, "name": "test tag2"}], - "status": "available", - "photoUrls": ["http://foo.bar.com/3", - "http://foo.bar.com/4"]} - pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) - pet.id = pet_dict["id"] - cate = petstore_api.Category() - cate.id = pet_dict["category"]["id"] - cate.name = pet_dict["category"]["name"] - pet.category = cate - tag1 = petstore_api.Tag() - tag1.id = pet_dict["tags"][0]["id"] - tag1.name = pet_dict["tags"][0]["name"] - tag2 = petstore_api.Tag() - tag2.id = pet_dict["tags"][1]["id"] - tag2.name = pet_dict["tags"][1]["name"] - pet.tags = [tag1, tag2] - pet.status = pet_dict["status"] - - data = pet - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, pet_dict) - - # list of models - list_of_pet_dict = [pet_dict] - data = [pet] - result = self.api_client.sanitize_for_serialization(data) - self.assertEqual(result, list_of_pet_dict) - - # model with additional proerties - model_dict = {'some_key': True} - model = petstore_api.StringBooleanMap(**model_dict) - result = self.api_client.sanitize_for_serialization(model) - self.assertEqual(result, model_dict) diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini deleted file mode 100644 index 3d0be613cfc7..000000000000 --- a/samples/openapi3/client/petstore/python-experimental/tox.ini +++ /dev/null @@ -1,10 +0,0 @@ -[tox] -envlist = py27, py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - nosetests \ - [] From d626293577ccd08a5b10b617498e30c8602f6eee Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 13:56:13 -0800 Subject: [PATCH 013/102] Add support for HTTP signature --- .../org/openapitools/codegen/CodegenSecurity.java | 7 +++++-- .../org/openapitools/codegen/DefaultCodegen.java | 5 +++++ .../org/openapitools/codegen/DefaultGenerator.java | 13 +++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index e7abb8c90d1a..65dfe5c8e491 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -30,7 +30,7 @@ public class CodegenSecurity { public String scheme; public Boolean hasMore, isBasic, isOAuth, isApiKey; // is Basic is true for all http authentication type. Those are to differentiate basic and bearer authentication - public Boolean isBasicBasic, isBasicBearer; + public Boolean isBasicBasic, isBasicBearer, isHttpSignature; public String bearerFormat; public Map vendorExtensions = new HashMap(); // ApiKey specific @@ -50,6 +50,7 @@ public CodegenSecurity filterByScopeNames(List filterScopes) { filteredSecurity.hasMore = false; filteredSecurity.isBasic = isBasic; filteredSecurity.isBasicBasic = isBasicBasic; + filteredSecurity.isHttpSignature = isHttpSignature; filteredSecurity.isBasicBearer = isBasicBearer; filteredSecurity.isApiKey = isApiKey; filteredSecurity.isOAuth = isOAuth; @@ -97,6 +98,7 @@ public boolean equals(Object o) { Objects.equals(isOAuth, that.isOAuth) && Objects.equals(isApiKey, that.isApiKey) && Objects.equals(isBasicBasic, that.isBasicBasic) && + Objects.equals(isHttpSignature, that.isHttpSignature) && Objects.equals(isBasicBearer, that.isBasicBearer) && Objects.equals(bearerFormat, that.bearerFormat) && Objects.equals(vendorExtensions, that.vendorExtensions) && @@ -117,7 +119,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isBasicBearer, + return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isHttpSignature, isBasicBearer, bearerFormat, vendorExtensions, keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow, authorizationUrl, tokenUrl, scopes, isCode, isPassword, isApplication, isImplicit); } @@ -133,6 +135,7 @@ public String toString() { sb.append(", isOAuth=").append(isOAuth); sb.append(", isApiKey=").append(isApiKey); sb.append(", isBasicBasic=").append(isBasicBasic); + sb.append(", isHttpSignature=").append(isHttpSignature); sb.append(", isBasicBearer=").append(isBasicBearer); sb.append(", bearerFormat='").append(bearerFormat).append('\''); sb.append(", vendorExtensions=").append(vendorExtensions); 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 d157cb808e0b..528ee088232b 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 @@ -3605,6 +3605,7 @@ public List fromSecurity(Map securitySc cs.name = key; cs.type = securityScheme.getType().toString(); cs.isCode = cs.isPassword = cs.isApplication = cs.isImplicit = false; + cs.isHttpSignature = false; cs.isBasicBasic = cs.isBasicBearer = false; cs.scheme = securityScheme.getScheme(); if (securityScheme.getExtensions() != null) { @@ -3626,6 +3627,10 @@ public List fromSecurity(Map securitySc } else if ("bearer".equals(securityScheme.getScheme())) { cs.isBasicBearer = true; cs.bearerFormat = securityScheme.getBearerFormat(); + } else if ("signature".equals(securityScheme.getScheme())) { + cs.isHttpSignature = true; + } else { + throw new RuntimeException("Unsupported security scheme: " + securityScheme.getScheme()); } } else if (SecurityScheme.Type.OAUTH2.equals(securityScheme.getType())) { cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isBasic = false; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 2d263ed3867b..7d3eb5dbab09 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -851,6 +851,9 @@ private Map buildSupportFileBundle(List allOperations, L if (hasBearerMethods(authMethods)) { bundle.put("hasBearerMethods", true); } + if (hasHttpSignatureMethods(authMethods)) { + bundle.put("hasHttpSignatureMethods", true); + } } List servers = config.fromServers(openAPI.getServers()); @@ -1332,6 +1335,16 @@ private boolean hasBearerMethods(List authMethods) { return false; } + private boolean hasHttpSignatureMethods(List authMethods) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isHttpSignature)) { + return true; + } + } + + return false; + } + private List getOAuthMethods(List authMethods) { List oauthMethods = new ArrayList<>(); From 9eca52c65f9ba6c2c7ab0a96aa0e3c64c4600874 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 14:02:50 -0800 Subject: [PATCH 014/102] Add code comments --- .../main/java/org/openapitools/codegen/CodegenSecurity.java | 4 +++- .../main/java/org/openapitools/codegen/DefaultCodegen.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index 65dfe5c8e491..62b456803746 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -29,7 +29,9 @@ public class CodegenSecurity { public String type; public String scheme; public Boolean hasMore, isBasic, isOAuth, isApiKey; - // is Basic is true for all http authentication type. Those are to differentiate basic and bearer authentication + // is Basic is true for all http authentication type. + // Those are to differentiate basic and bearer authentication + // isHttpSignature is to support https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ public Boolean isBasicBasic, isBasicBearer, isHttpSignature; public String bearerFormat; public Map vendorExtensions = new HashMap(); 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 528ee088232b..cd48d0816723 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 @@ -3628,6 +3628,9 @@ public List fromSecurity(Map securitySc cs.isBasicBearer = true; cs.bearerFormat = securityScheme.getBearerFormat(); } else if ("signature".equals(securityScheme.getScheme())) { + // HTTP signature as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + // The registry of security schemes is maintained by IANA. + // https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml cs.isHttpSignature = true; } else { throw new RuntimeException("Unsupported security scheme: " + securityScheme.getScheme()); From a59f75979a851cbbdd1a8c818bf70adb28c691d3 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 14:08:20 -0800 Subject: [PATCH 015/102] Add code comments --- .../main/java/org/openapitools/codegen/DefaultGenerator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 7d3eb5dbab09..161a136b7e06 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -1335,6 +1335,9 @@ private boolean hasBearerMethods(List authMethods) { return false; } + // hasHttpSignatureMethods returns true if the specified OAS model has + // HTTP signature methods. + // The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ private boolean hasHttpSignatureMethods(List authMethods) { for (CodegenSecurity cs : authMethods) { if (Boolean.TRUE.equals(cs.isHttpSignature)) { From 16c1891061fbe31be743de8688400e3dd5f67d19 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 14:13:24 -0800 Subject: [PATCH 016/102] Fix formatting issues --- .../src/main/resources/python/configuration.mustache | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index d534fc72b179..7a0767ecb5e3 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -44,7 +44,8 @@ class Configuration(object): def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -80,7 +81,8 @@ class Configuration(object): """The path of the file containing a private key, used to sign HTTP requests. """ self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. From a1a181c177f2986d9528324527edef6a0b6f26cd Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 14:22:04 -0800 Subject: [PATCH 017/102] Fix formatting issues --- .../src/main/resources/python/configuration.mustache | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 7a0767ecb5e3..5f51b71fcfb5 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -82,12 +82,12 @@ class Configuration(object): """ self.signing_scheme = signing_scheme """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. + Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers """A list of HTTP headers that must be signed, when signing HTTP requests. @@ -144,7 +144,8 @@ class Configuration(object): """ {{#hasHttpSignatureMethods}} self.private_key = None - """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. """ {{/hasHttpSignatureMethods}} From 7f1c4cfe031e5686858d30a19481949836df330a Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 14:29:07 -0800 Subject: [PATCH 018/102] Fix formatting issues --- .../src/main/resources/python/configuration.mustache | 2 ++ .../python/python-experimental/api_client.mustache | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 5f51b71fcfb5..e9a9614c1673 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -353,6 +353,8 @@ class Configuration(object): def load_private_key(self): """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. """ if self.private_key is not None: return diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 14d389a5d56f..e386c623b909 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -541,8 +541,10 @@ class ApiClient(object): if auth_setting: {{#hasHttpSignatureMethods}} if auth_setting['type'] == 'http-signature': - # The HTTP signature scheme requires multiple HTTP headers that are calculated dynamically. - auth_headers = self.get_http_signature_headers(resource_path, method, headers, body, querys) + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + auth_headers = self.get_http_signature_headers(resource_path, method, + headers, body, querys) for key, value in auth_headers.items(): headers[key] = value continue @@ -633,7 +635,8 @@ class ApiClient(object): digest = SHA256.new() prefix = "SHA-256=" else: - raise Exception("Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) + raise Exception( + "Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) digest.update(data) return digest, prefix @@ -698,7 +701,8 @@ class ApiClient(object): auth_str = "" auth_str = auth_str + "Signature" - auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" + auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + + self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" for key, _ in hdrs.items(): auth_str = auth_str + " " + key.lower() From 9e6395fa4ec299a16e18ff895763177a21e3eb1b Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 16:24:03 -0800 Subject: [PATCH 019/102] add code comments --- .../src/main/java/org/openapitools/codegen/DefaultCodegen.java | 2 ++ 1 file changed, 2 insertions(+) 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 cd48d0816723..157ec4a0a80d 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 @@ -3631,6 +3631,8 @@ public List fromSecurity(Map securitySc // HTTP signature as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ // The registry of security schemes is maintained by IANA. // https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml + // As of January 2020, the "signature" scheme has not been registered with IANA yet. + // This scheme may have to be changed when it is officially registered with IANA. cs.isHttpSignature = true; } else { throw new RuntimeException("Unsupported security scheme: " + securityScheme.getScheme()); From e5616dd246173a3acb6f55a4660f8f8c1d033224 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Mon, 13 Jan 2020 16:31:51 -0800 Subject: [PATCH 020/102] add code comments --- .../resources/python/python-experimental/api_client.mustache | 4 ++-- .../3_0/petstore-with-fake-endpoints-models-for-testing.yaml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index e386c623b909..a5cd93abb319 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -565,13 +565,13 @@ class ApiClient(object): {{#hasHttpSignatureMethods}} def get_http_signature_headers(self, resource_path, method, headers, body, query_params): """ - Create a message signature for the HTTP request and add the signed headers. + Create a cryptographic message signature for the HTTP request and add the signed headers. :param resource_path : resource path which is the api being called upon. :param method: the HTTP request method. :param headers: the request headers. :param body: body passed in the http request. - :param query_params: query parameters used by the API + :param query_params: query parameters used by the API. :return: instance of digest object """ if method is None: diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index d1787509bbbe..d747440c1dc4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1169,6 +1169,9 @@ components: scheme: bearer bearerFormat: JWT http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ type: http scheme: signature schemas: From 9fdb7ef5a7803225b17d0289600d277a2272c67e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 09:36:23 -0800 Subject: [PATCH 021/102] fix python formatting issues --- .../python-asyncio/petstore_api/configuration.py | 10 ++++++---- .../python-experimental/petstore_api/configuration.py | 10 ++++++---- .../python-tornado/petstore_api/configuration.py | 10 ++++++---- .../petstore/python/petstore_api/configuration.py | 10 ++++++---- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index f26151ba3252..ffa504858f64 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -45,7 +45,8 @@ class Configuration(object): def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -81,12 +82,13 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """The path of the file containing a private key, used to sign HTTP requests. """ self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers """A list of HTTP headers that must be signed, when signing HTTP requests. diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 495fedb65897..3d7184800a30 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -46,7 +46,8 @@ class Configuration(object): def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -82,12 +83,13 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """The path of the file containing a private key, used to sign HTTP requests. """ self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers """A list of HTTP headers that must be signed, when signing HTTP requests. diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 495fedb65897..3d7184800a30 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -46,7 +46,8 @@ class Configuration(object): def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -82,12 +83,13 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """The path of the file containing a private key, used to sign HTTP requests. """ self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers """A list of HTTP headers that must be signed, when signing HTTP requests. diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 495fedb65897..3d7184800a30 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -46,7 +46,8 @@ class Configuration(object): def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -82,12 +83,13 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """The path of the file containing a private key, used to sign HTTP requests. """ self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512. + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + For RSA keys, supported values are PKCS1-v1_5, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers """A list of HTTP headers that must be signed, when signing HTTP requests. From ae56f20eb8da4ea79206c9cd59f1c230179af5c4 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 09:39:29 -0800 Subject: [PATCH 022/102] Make PKCS1v15 string constant consistent between Python and Golang --- .../src/main/resources/python/configuration.mustache | 4 ++-- .../resources/python/python-experimental/api_client.mustache | 2 +- .../petstore/python-asyncio/petstore_api/configuration.py | 4 ++-- .../python-experimental/petstore_api/configuration.py | 4 ++-- .../petstore/python-tornado/petstore_api/configuration.py | 4 ++-- samples/client/petstore/python/petstore_api/configuration.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index e9a9614c1673..bae248680ef0 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -36,7 +36,7 @@ class Configuration(object): :param signing_scheme: The signature scheme, when signing HTTP requests. Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. """ @@ -86,7 +86,7 @@ class Configuration(object): """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. + For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index a5cd93abb319..6bb1bb5e31c6 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -653,7 +653,7 @@ class ApiClient(object): if self.configuration.signing_algorithm == 'PSS': # RSASSA-PSS in Section 8.1 of RFC8017. signature = pss.new(privkey).sign(digest) - elif self.configuration.signing_algorithm == 'PKCS1-v1_5': + elif self.configuration.signing_algorithm == 'PKCS1v15': # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. signature = PKCS1_v1_5.new(privkey).sign(digest) else: diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index ffa504858f64..b20f1059eef5 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -37,7 +37,7 @@ class Configuration(object): :param signing_scheme: The signature scheme, when signing HTTP requests. Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. """ @@ -87,7 +87,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. + For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 3d7184800a30..486988d237df 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -38,7 +38,7 @@ class Configuration(object): :param signing_scheme: The signature scheme, when signing HTTP requests. Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. """ @@ -88,7 +88,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. + For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 3d7184800a30..486988d237df 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -38,7 +38,7 @@ class Configuration(object): :param signing_scheme: The signature scheme, when signing HTTP requests. Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. """ @@ -88,7 +88,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. + For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 3d7184800a30..486988d237df 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -38,7 +38,7 @@ class Configuration(object): :param signing_scheme: The signature scheme, when signing HTTP requests. Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1-v1_5, PSS; fips-186-3, deterministic-rfc6979. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. """ @@ -88,7 +88,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """ self.signing_algorithm = signing_algorithm """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1-v1_5, PSS. + For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers From c4c23b82cf8736781e31b7c90c395e54459e5331 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 10:27:25 -0800 Subject: [PATCH 023/102] fix python formatting issues --- samples/client/petstore/python-experimental/docs/Player.md | 2 +- .../python-experimental/petstore_api/models/player.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/client/petstore/python-experimental/docs/Player.md b/samples/client/petstore/python-experimental/docs/Player.md index 87c2c6b27ba4..34adf5302a00 100644 --- a/samples/client/petstore/python-experimental/docs/Player.md +++ b/samples/client/petstore/python-experimental/docs/Player.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | -**enemy_player** | [**player.Player**](Player.md) | | [optional] +**enemy_player** | [**Player**](Player.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/player.py b/samples/client/petstore/python-experimental/petstore_api/models/player.py index c7266e840283..75b3ca337674 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/player.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/player.py @@ -74,7 +74,7 @@ def openapi_types(): """ return { 'name': (str,), # noqa: E501 - 'enemy_player': (player.Player,), # noqa: E501 + 'enemy_player': (Player,), # noqa: E501 } @staticmethod @@ -118,7 +118,7 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), deserializing a file_type parameter. If passed, type conversion is attempted If omitted no type conversion is done. - enemy_player (player.Player): [optional] # noqa: E501 + enemy_player (Player): [optional] # noqa: E501 """ self._data_store = {} From 8948135e982e8dfb5d0acaaf770502452b7f0300 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 10:54:26 -0800 Subject: [PATCH 024/102] Add code comments in generated Python. Start adding unit tests for HTTP signature --- .../resources/python/configuration.mustache | 26 ++++++++++++++++ .../petstore_api/configuration.py | 26 ++++++++++++++++ .../petstore_api/configuration.py | 26 ++++++++++++++++ .../python-experimental/tests/test_pet_api.py | 30 +++++++++++++++++++ .../petstore_api/configuration.py | 26 ++++++++++++++++ .../python/petstore_api/configuration.py | 26 ++++++++++++++++ 6 files changed, 160 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index bae248680ef0..c53240b47cb1 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -31,6 +31,9 @@ class Configuration(object): :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. :param private_key_path: The path of the file containing a private key, when signing HTTP requests. :param signing_scheme: The signature scheme, when signing HTTP requests. @@ -39,6 +42,29 @@ class Configuration(object): Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + + :Example: + + Configure HTTP signature: + conf = {{{packageName}}}.Configuration( + key_id='my-key-id', + private_key_path='rsa.pem', + signing_scheme='hs2019', + signing_algorithm='PSS', + signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + ) """ def __init__(self, host="{{{basePath}}}", diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index b20f1059eef5..e74d5ade8329 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -32,6 +32,9 @@ class Configuration(object): :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. :param private_key_path: The path of the file containing a private key, when signing HTTP requests. :param signing_scheme: The signature scheme, when signing HTTP requests. @@ -40,6 +43,29 @@ class Configuration(object): Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + + :Example: + + Configure HTTP signature: + conf = petstore_api.Configuration( + key_id='my-key-id', + private_key_path='rsa.key', + signing_scheme='hs2019', + signing_algorithm='PSS', + signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 486988d237df..7398c1141929 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -33,6 +33,9 @@ class Configuration(object): :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. :param private_key_path: The path of the file containing a private key, when signing HTTP requests. :param signing_scheme: The signature scheme, when signing HTTP requests. @@ -41,6 +44,29 @@ class Configuration(object): Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + + :Example: + + Configure HTTP signature: + conf = petstore_api.Configuration( + key_id='my-key-id', + private_key_path='rsa.key', + signing_scheme='hs2019', + signing_algorithm='PSS', + signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 5e1dd8528c9c..2d4f3e69a1dc 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -154,6 +154,36 @@ def test_separate_default_config_instances(self): pet_api2.api_client.configuration.host = 'someotherhost' self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) + def test_http_signature(self): + config = Configuration( + key_id="my-key-id", + private_key_path="rsa.pem", + signing_scheme="hs2019", + signing_algorithm='PKCS1v15', + signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest']) + config.host = HOST + self.api_client = petstore_api.ApiClient(config) + self.pet_api = petstore_api.PetApi(self.api_client) + + mock_pool = MockPoolManager(self) + self.api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(total=5)) + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) + + self.pet_api.add_pet(self.pet, _request_timeout=5) + self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) + def test_async_request(self): thread = self.pet_api.add_pet(self.pet, async_req=True) response = thread.get() diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 486988d237df..7398c1141929 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -33,6 +33,9 @@ class Configuration(object): :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. :param private_key_path: The path of the file containing a private key, when signing HTTP requests. :param signing_scheme: The signature scheme, when signing HTTP requests. @@ -41,6 +44,29 @@ class Configuration(object): Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + + :Example: + + Configure HTTP signature: + conf = petstore_api.Configuration( + key_id='my-key-id', + private_key_path='rsa.key', + signing_scheme='hs2019', + signing_algorithm='PSS', + signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 486988d237df..7398c1141929 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -33,6 +33,9 @@ class Configuration(object): :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. :param private_key_path: The path of the file containing a private key, when signing HTTP requests. :param signing_scheme: The signature scheme, when signing HTTP requests. @@ -41,6 +44,29 @@ class Configuration(object): Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. :param signed_headers: A list of HTTP headers that must be added to the signed message, when signing HTTP requests. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + + :Example: + + Configure HTTP signature: + conf = petstore_api.Configuration( + key_id='my-key-id', + private_key_path='rsa.key', + signing_scheme='hs2019', + signing_algorithm='PSS', + signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", From 176f1305cc6d368fbfe610e857aa4c92ed76068e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 11:46:24 -0800 Subject: [PATCH 025/102] compliance with HTTP signature draft 12 --- .../resources/python/configuration.mustache | 8 +- .../python-experimental/api_client.mustache | 66 ++++++++++------- .../petstore_api/configuration.py | 10 ++- .../petstore_api/configuration.py | 10 ++- .../petstore_api/configuration.py | 10 ++- .../python/petstore_api/configuration.py | 10 ++- .../python/petstore_api/configuration.py | 74 +++++++++++++------ 7 files changed, 130 insertions(+), 58 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index c53240b47cb1..bd0c687ca125 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -57,7 +57,13 @@ class Configuration(object): :Example: - Configure HTTP signature: + Configure API client with HTTP basic authentication: + conf = {{{packageName}}}.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication: conf = {{{packageName}}}.Configuration( key_id='my-key-id', private_key_path='rsa.pem', diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 6bb1bb5e31c6..16039f37db62 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -592,34 +592,49 @@ class ApiClient(object): raw_query = urlencode(query_params).replace('+', '%20') request_target += "?" + raw_query + # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. from email.utils import formatdate - cdate=formatdate(timeval=None, localtime=False, usegmt=True) + now = datetime.datetime.now() + stamp = mktime(now.timetuple()) + cdate=formatdate(timeval=stamp, localtime=False, usegmt=True) + created=now.strftime("%s") - request_body = body.encode() - body_digest, digest_prefix = self.get_message_digest(request_body) - b64_body_digest = b64encode(body_digest.digest()) - - signed_headers = { - 'Date': cdate, - 'Host': target_host, - 'Digest': digest_prefix + b64_body_digest.decode('ascii') - } + signed_headers = {} + signed_header_dict = {} for hdr_key in self.configuration.signed_headers: - signed_headers[hdr_key] = headers[hdr_key] + hdr_key = hdr_key.lower() + if hdr_key == '(request-target)': + value = request_target + elif hdr_key == '(created)': + value = created + elif hdr_key == 'date': + value = cdate + signed_header_dict['Date'] = '{0}'.format(cdate) + elif hdr_key == 'digest': + request_body = body.encode() + body_digest, digest_prefix = self.get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + signed_header_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == 'host': + value = target_host + signed_header_dict['Host'] = '{0}'.format(target_host) + else: + value = headers[hdr_key] + signed_headers[hdr_key] = value - string_to_sign = self.get_str_to_sign(request_target, signed_headers) + if len(self.configuration.signed_headers) == 0: + signed_headers['(created)'] = created + + string_to_sign = self.get_str_to_sign(signed_headers) digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) b64_signed_msg = self.sign_digest(digest) auth_header = self.get_authorization_header(signed_headers, b64_signed_msg) + signed_header_dict['Authorization'] = '{0}'.format(auth_header) - return { - 'Date': '{0}'.format(cdate), - 'Host': '{0}'.format(target_host), - 'Digest': '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')), - 'Authorization': '{0}'.format(auth_header) - } + return signed_header_dict def get_message_digest(self, data): """ @@ -667,24 +682,19 @@ class ApiClient(object): raise Exception("Unsupported private key: {0}".format(type(privkey))) return b64encode(signature) - def get_str_to_sign(self, req_tgt, hdrs): + def get_str_to_sign(self, signed_headers): """ Generate and return a string value representing the HTTP request to be signed. - :param req_tgt : Request Target as stored in http header. - :param hdrs: HTTP Headers to be signed. + :param signed_headers: The HTTP Headers to be signed. :return: instance of digest object """ ss = "" - ss = ss + "(request-target): " + req_tgt + "\n" - - length = len(hdrs.items()) - i = 0 - for key, value in hdrs.items(): - ss = ss + key.lower() + ": " + value - if i < length-1: + for key, value in signed_headers.items(): + if i > 0: ss = ss + "\n" + ss = ss + key.lower() + ": " + value i += 1 return ss diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index e74d5ade8329..ba0b33e87430 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -58,10 +58,16 @@ class Configuration(object): :Example: - Configure HTTP signature: + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication: conf = petstore_api.Configuration( key_id='my-key-id', - private_key_path='rsa.key', + private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 7398c1141929..2b4ad5d945d0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -59,10 +59,16 @@ class Configuration(object): :Example: - Configure HTTP signature: + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication: conf = petstore_api.Configuration( key_id='my-key-id', - private_key_path='rsa.key', + private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 7398c1141929..2b4ad5d945d0 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -59,10 +59,16 @@ class Configuration(object): :Example: - Configure HTTP signature: + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication: conf = petstore_api.Configuration( key_id='my-key-id', - private_key_path='rsa.key', + private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 7398c1141929..2b4ad5d945d0 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -59,10 +59,16 @@ class Configuration(object): :Example: - Configure HTTP signature: + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication: conf = petstore_api.Configuration( key_id='my-key-id', - private_key_path='rsa.key', + private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 2c8e2e27e134..150d76051a31 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -32,16 +32,54 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the key used to sign HTTP requests - :param private_key_path: The path of the file containing a private key, used to sign HTTP requests - :param signing_algorithm: The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 - :param signed_headers: A list of HTTP headers that must be signed, when signing HTTP requests + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signed_headers: A list of HTTP headers that must be added to the signed message, + when signing HTTP requests. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + + :Example: + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication: + conf = petstore_api.Configuration( + key_id='my-key-id', + private_key_path='rsa.pem', + signing_scheme='hs2019', + signing_algorithm='PSS', + signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_algorithm=None, signed_headers=None): + key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signed_headers=None): """Constructor """ self.host = host @@ -71,16 +109,22 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Password for HTTP basic authentication """ self.key_id = key_id - """The identifier of the key used to sign HTTP requests + """The identifier of the key used to sign HTTP requests. """ self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. """ self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. Supported values are hs2019, rsa-sha256, rsa-sha512 + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1v15, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests + """A list of HTTP headers that must be signed, when signing HTTP requests. """ self.access_token = "" """access token for OAuth/Bearer @@ -124,10 +168,6 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", """Set this to True/False to enable/disable SSL hostname verification. """ - self.private_key = None - """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. - """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is @@ -296,13 +336,6 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_basic_auth_token() }, - 'http_signature_test': - { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - }, 'petstore_auth': { 'type': 'oauth2', @@ -312,7 +345,6 @@ def auth_settings(self): }, } - def to_debug_report(self): """Gets the essential information for debugging. From e4c0e1ae56d9a5d1fd6e9f55a467e5556b47f5fe Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 12:00:45 -0800 Subject: [PATCH 026/102] compliance with HTTP signature draft 12 --- .../python-experimental/api_client.mustache | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 16039f37db62..bc63bfab4e67 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -631,7 +631,7 @@ class ApiClient(object): digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) b64_signed_msg = self.sign_digest(digest) - auth_header = self.get_authorization_header(signed_headers, b64_signed_msg) + auth_header = self.get_authorization_header(signed_headers, b64_signed_msg, created) signed_header_dict['Authorization'] = '{0}'.format(auth_header) return signed_header_dict @@ -699,23 +699,38 @@ class ApiClient(object): return ss - def get_authorization_header(self, hdrs, signed_msg): + def get_authorization_header(self, signed_headers, signed_msg, created_ts): """ Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - :param hdrs : The list of signed HTTP Headers - :param signed_msg: Signed Digest + :param signed_headers : The list of signed HTTP Headers. + :param signed_msg: Signed Digest. + :param created_ts: The time when the signature was created, as a UNIX timestamp. :return: instance of digest object """ + i = 0 + headers_value = "" + is_created_set = False + for key, _ in signed_headers.items(): + key = key.lower() + if i > 0: + headers_value = headers_value + " " + headers_value = headers_value + key + if key == '(created)': + is_created_set = True + i += 1 + auth_str = "" auth_str = auth_str + "Signature" auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + - self.configuration.signing_scheme + "\"," + "headers=\"(request-target)" + self.configuration.signing_scheme + "\"," + if is_created_set: + auth_str = auth_str + "created={0},".format(created_ts) + auth_str = auth_str + "headers=\"" + auth_str = auth_str + headers_value - for key, _ in hdrs.items(): - auth_str = auth_str + " " + key.lower() auth_str = auth_str + "\"" auth_str = auth_str + "," + "signature=\"" + signed_msg.decode('ascii') + "\"" From e4cc4df417e09266a11b2e69f570b3ffad57fe77 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 13:24:55 -0800 Subject: [PATCH 027/102] working on review comments --- .../resources/python/configuration.mustache | 7 +- .../python-experimental/api_client.mustache | 80 +++++++------------ .../petstore_api/api_client.py | 3 + .../petstore_api/configuration.py | 7 +- 4 files changed, 42 insertions(+), 55 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index bd0c687ca125..9f2933be8147 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -40,8 +40,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of HTTP headers that must be added to the signed message, - when signing HTTP requests. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be included in SignedHeaders. The '(created)' header expresses when the signature was created. @@ -122,7 +122,8 @@ class Configuration(object): For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests. + """A list of strings. Each value is the name of HTTP header that must be included in the + HTTP signature calculation. """ {{#hasOAuthMethods}} self.access_token = "" diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index bc63bfab4e67..8fa581881318 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -15,6 +15,7 @@ from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from Crypto.Hash import SHA256, SHA512 from base64 import b64encode +from email.utils import formatdate {{/hasHttpSignatureMethods}} {{#tornado}} import tornado.gen @@ -36,6 +37,9 @@ from {{packageName}}.model_utils import ( ) +ECDSA_KEY_SIGNING_ALGORITHMS = {'fips-186-3', 'deterministic-rfc6979'} + + class ApiClient(object): """Generic API client for OpenAPI client library builds. @@ -568,11 +572,11 @@ class ApiClient(object): Create a cryptographic message signature for the HTTP request and add the signed headers. :param resource_path : resource path which is the api being called upon. - :param method: the HTTP request method. - :param headers: the request headers. - :param body: body passed in the http request. - :param query_params: query parameters used by the API. - :return: instance of digest object + :param method: the HTTP request method, e.g. GET, POST. + :param headers: The HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: The HTTP request query parameters. + :return: A dictionary of HTTP headers that must be added to the outbound HTTP request. """ if method is None: raise Exception("HTTP method must be set") @@ -593,11 +597,10 @@ class ApiClient(object): request_target += "?" + raw_query # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. - from email.utils import formatdate now = datetime.datetime.now() stamp = mktime(now.timetuple()) - cdate=formatdate(timeval=stamp, localtime=False, usegmt=True) - created=now.strftime("%s") + cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) + created = now.strftime("%s") signed_headers = {} signed_header_dict = {} @@ -626,7 +629,11 @@ class ApiClient(object): if len(self.configuration.signed_headers) == 0: signed_headers['(created)'] = created - string_to_sign = self.get_str_to_sign(signed_headers) + string_to_sign = "" + for i, (key, value) in enumerate(signed_headers.items()): + string_to_sign += key.lower() + ": " + value + if i > 0: + string_to_sign += "\n" digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) b64_signed_msg = self.sign_digest(digest) @@ -659,8 +666,8 @@ class ApiClient(object): """ Signs a message digest with a private key specified in the configuration. - :param digest: digest of the HTTP message. - :return: the HTTP message signature encoded as a byte string. + :param digest: A byte string representing the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. """ self.configuration.load_private_key() privkey = self.configuration.private_key @@ -674,7 +681,7 @@ class ApiClient(object): else: raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) elif isinstance(privkey, ECC.EccKey): - if self.configuration.signing_algorithm in ['fips-186-3', 'deterministic-rfc6979']: + if self.configuration.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) else: raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) @@ -682,59 +689,34 @@ class ApiClient(object): raise Exception("Unsupported private key: {0}".format(type(privkey))) return b64encode(signature) - def get_str_to_sign(self, signed_headers): - """ - Generate and return a string value representing the HTTP request to be signed. - - :param signed_headers: The HTTP Headers to be signed. - :return: instance of digest object - """ - ss = "" - i = 0 - for key, value in signed_headers.items(): - if i > 0: - ss = ss + "\n" - ss = ss + key.lower() + ": " + value - i += 1 - - return ss - def get_authorization_header(self, signed_headers, signed_msg, created_ts): """ Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - :param signed_headers : The list of signed HTTP Headers. + :param signed_headers : A list of strings. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. :param signed_msg: Signed Digest. - :param created_ts: The time when the signature was created, as a UNIX timestamp. - :return: instance of digest object + :param created_ts: The string representation of the time when the signature was created, + as a UNIX timestamp value. + :return: The string value of the 'Authorization' header, containing the HTTP request signature. """ - i = 0 headers_value = "" is_created_set = False - for key, _ in signed_headers.items(): + for i, key in enumerate(signed_headers) key = key.lower() + headers_value += key if i > 0: - headers_value = headers_value + " " - headers_value = headers_value + key + headers_value += " " if key == '(created)': is_created_set = True - i += 1 - - auth_str = "" - auth_str = auth_str + "Signature" - auth_str = auth_str + " " + "keyId=\"" + self.configuration.key_id + "\"," + "algorithm=\"" + - self.configuration.signing_scheme + "\"," + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," + .format(self.configuration.key_id, self.configuration.signing_scheme) if is_created_set: auth_str = auth_str + "created={0},".format(created_ts) - auth_str = auth_str + "headers=\"" - auth_str = auth_str + headers_value - - auth_str = auth_str + "\"" - - auth_str = auth_str + "," + "signature=\"" + signed_msg.decode('ascii') + "\"" - + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" + .format(headers_value, signed_msg.decode('ascii')) return auth_str {{/hasHttpSignatureMethods}} diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 61773c8abe90..a4dce34d70bd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -35,6 +35,9 @@ ) +ECDSA_KEY_SIGNING_ALGORITHMS = {'fips-186-3', 'deterministic-rfc6979'} + + class ApiClient(object): """Generic API client for OpenAPI client library builds. diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 2b4ad5d945d0..ed76f9452296 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -42,8 +42,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of HTTP headers that must be added to the signed message, - when signing HTTP requests. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be included in SignedHeaders. The '(created)' header expresses when the signature was created. @@ -124,7 +124,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests. + """A list of strings. Each value is the name of HTTP header that must be included in the + HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer From e5811b0d370a8fe0eb58593c00b2ed792fe2f2c8 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 13:29:08 -0800 Subject: [PATCH 028/102] working on review comments --- .../resources/python/python-experimental/api_client.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 8fa581881318..a433792ff940 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -698,7 +698,8 @@ class ApiClient(object): :param signed_msg: Signed Digest. :param created_ts: The string representation of the time when the signature was created, as a UNIX timestamp value. - :return: The string value of the 'Authorization' header, containing the HTTP request signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. """ headers_value = "" From 916416d441d910c80fbfb570a966fa5cdf536a28 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 13:36:57 -0800 Subject: [PATCH 029/102] working on review comments --- .../python-experimental/api_client.mustache | 18 +++++++++--------- .../petstore_api/configuration.py | 7 ++++--- .../petstore_api/api_client.py | 6 +++--- .../petstore_api/configuration.py | 7 ++++--- .../python/petstore_api/configuration.py | 7 ++++--- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index a433792ff940..0bdc8ac39367 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -533,9 +533,9 @@ class ApiClient(object): :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :resource_path: The HTTP request resource path. - :method: The HTTP request method. - :body: The body of the HTTP request. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A string representation of the body of the HTTP request. """ if not auth_settings: return @@ -571,12 +571,12 @@ class ApiClient(object): """ Create a cryptographic message signature for the HTTP request and add the signed headers. - :param resource_path : resource path which is the api being called upon. - :param method: the HTTP request method, e.g. GET, POST. - :param headers: The HTTP request headers. + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. :param body: The string representation of the HTTP request body. - :param query_params: The HTTP request query parameters. - :return: A dictionary of HTTP headers that must be added to the outbound HTTP request. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. """ if method is None: raise Exception("HTTP method must be set") @@ -631,7 +631,7 @@ class ApiClient(object): string_to_sign = "" for i, (key, value) in enumerate(signed_headers.items()): - string_to_sign += key.lower() + ": " + value + string_to_sign += "{0}: {1}".format(key.lower(), value) if i > 0: string_to_sign += "\n" diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index ba0b33e87430..32d0ed7304fa 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -41,8 +41,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of HTTP headers that must be added to the signed message, - when signing HTTP requests. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be included in SignedHeaders. The '(created)' header expresses when the signature was created. @@ -123,7 +123,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests. + """A list of strings. Each value is the name of HTTP header that must be included in the + HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index a4dce34d70bd..00118cc956e3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -519,9 +519,9 @@ def update_params_for_auth(self, headers, querys, auth_settings, resource_path=N :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. - :resource_path: The HTTP request resource path. - :method: The HTTP request method. - :body: The body of the HTTP request. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A string representation of the body of the HTTP request. """ if not auth_settings: return diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 2b4ad5d945d0..ed76f9452296 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -42,8 +42,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of HTTP headers that must be added to the signed message, - when signing HTTP requests. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be included in SignedHeaders. The '(created)' header expresses when the signature was created. @@ -124,7 +124,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests. + """A list of strings. Each value is the name of HTTP header that must be included in the + HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 2b4ad5d945d0..ed76f9452296 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -42,8 +42,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of HTTP headers that must be added to the signed message, - when signing HTTP requests. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be included in SignedHeaders. The '(created)' header expresses when the signature was created. @@ -124,7 +124,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests. + """A list of strings. Each value is the name of HTTP header that must be included in the + HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer From 7db2a6222fbc0b0eba586fda470f6ab337b461b1 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 13:51:00 -0800 Subject: [PATCH 030/102] working on review comments --- .../python/python-experimental/api_client.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 0bdc8ac39367..02ad6ee04e33 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -647,8 +647,8 @@ class ApiClient(object): """ Calculates and returns a cryptographic digest of a specified HTTP request. - :param data: The message to be hashed with a cryptographic hash. - :return: The message digest encoded as a byte string. + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: The hashing object that contains the cryptographic digest of the HTTP request. """ if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: digest = SHA512.new() @@ -666,7 +666,7 @@ class ApiClient(object): """ Signs a message digest with a private key specified in the configuration. - :param digest: A byte string representing the cryptographic digest of the HTTP request. + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. :return: A base-64 string representing the cryptographic signature of the input digest. """ self.configuration.load_private_key() @@ -695,7 +695,7 @@ class ApiClient(object): :param signed_headers : A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. - :param signed_msg: Signed Digest. + :param signed_msg: A base-64 encoded string representation of the signature. :param created_ts: The string representation of the time when the signature was created, as a UNIX timestamp value. :return: The string value of the 'Authorization' header, representing the signature From fac1af1347e914bd8ffe84317cdf177176142475 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 14:04:15 -0800 Subject: [PATCH 031/102] working on review comments --- .../python/python-experimental/api_client.mustache | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 02ad6ee04e33..e22d5d7bed40 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -37,9 +37,6 @@ from {{packageName}}.model_utils import ( ) -ECDSA_KEY_SIGNING_ALGORITHMS = {'fips-186-3', 'deterministic-rfc6979'} - - class ApiClient(object): """Generic API client for OpenAPI client library builds. @@ -67,6 +64,10 @@ class ApiClient(object): PRIMITIVE_TYPES = ( (float, bool, six.binary_type, six.text_type) + six.integer_types ) + ECDSA_MODE_FIPS_186_3 = 'fips-186-3' + ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' + ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} + _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, From e053076ac2902b65b7ccd2a5b639f9aee1138d10 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 15:02:53 -0800 Subject: [PATCH 032/102] working on review comments --- .../resources/python/python-experimental/api_client.mustache | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index e22d5d7bed40..34dda5ec6d07 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -649,7 +649,10 @@ class ApiClient(object): Calculates and returns a cryptographic digest of a specified HTTP request. :param data: The string representation of the date to be hashed with a cryptographic hash. - :return: The hashing object that contains the cryptographic digest of the HTTP request. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used to generate the + 'Digest' header as specified in RFC 3230. """ if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: digest = SHA512.new() From 2ef4815e9ebd978993822739da31a783cae19f19 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 17:44:05 -0800 Subject: [PATCH 033/102] working on review comments --- .../python-experimental/api_client.mustache | 10 ++++++---- .../petstore_api/api_client.py | 15 +++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 34dda5ec6d07..db092465340a 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -9,8 +9,9 @@ import os # python 2 and python 3 compatibility library import six -from six.moves.urllib.parse import quote, urlencode, urlparse +from six.moves.urllib.parse import quote, urlparse {{#hasHttpSignatureMethods}} +from six.moves.urllib.parse import urlencode from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from Crypto.Hash import SHA256, SHA512 @@ -162,7 +163,8 @@ class ApiClient(object): post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) # body if body: @@ -528,7 +530,8 @@ class ApiClient(object): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path=None, method=None, body=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -723,5 +726,4 @@ class ApiClient(object): auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" .format(headers_value, signed_msg.decode('ascii')) return auth_str - {{/hasHttpSignatureMethods}} diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 00118cc956e3..aca9349cbecd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from six.moves.urllib.parse import quote, urlencode, urlparse +from six.moves.urllib.parse import quote, urlparse from petstore_api import rest from petstore_api.configuration import Configuration @@ -35,9 +35,6 @@ ) -ECDSA_KEY_SIGNING_ALGORITHMS = {'fips-186-3', 'deterministic-rfc6979'} - - class ApiClient(object): """Generic API client for OpenAPI client library builds. @@ -65,6 +62,10 @@ class ApiClient(object): PRIMITIVE_TYPES = ( (float, bool, six.binary_type, six.text_type) + six.integer_types ) + ECDSA_MODE_FIPS_186_3 = 'fips-186-3' + ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' + ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} + _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, @@ -156,7 +157,8 @@ def __call_api( post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) # body if body: @@ -513,7 +515,8 @@ def select_header_content_type(self, content_types): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings, resource_path=None, method=None, body=None): + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path=None, method=None, body=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. From a3e3c7206593da1c1747c31e0b1a25e6e7fbcce2 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 17:46:48 -0800 Subject: [PATCH 034/102] working on review comments --- .../resources/python/python-experimental/api_client.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index db092465340a..ad025a984473 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -642,8 +642,8 @@ class ApiClient(object): digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) b64_signed_msg = self.sign_digest(digest) - auth_header = self.get_authorization_header(signed_headers, b64_signed_msg, created) - signed_header_dict['Authorization'] = '{0}'.format(auth_header) + signed_header_dict['Authorization'] = self.get_authorization_header( + signed_headers, b64_signed_msg, created) return signed_header_dict From b56e38f0c4f82d5c28b358786747bf3a9e11b12e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 14 Jan 2020 18:36:23 -0800 Subject: [PATCH 035/102] working on review comments --- .../python-experimental/api_client.mustache | 73 ++++++++++++------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index ad025a984473..8e0b7cef2f74 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -571,31 +571,24 @@ class ApiClient(object): ) {{#hasHttpSignatureMethods}} - def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + def get_signed_header_info(self, resource_path, method, headers, body, query_params): """ - Create a cryptographic message signature for the HTTP request and add the signed headers. - + Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. + :param resource_path : A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method, e.g. GET, POST. :param headers: A dict containing the HTTP request headers. :param body: The string representation of the HTTP request body. :param query_params: A string representing the HTTP request query parameters. - :return: A dict of HTTP headers that must be added to the outbound HTTP request. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate the HTTP signature. + The second dict contains the HTTP headers that must be added to the outbound HTTP request. """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - if body is None: - body = '' - else: - body = json.dumps(body) + # Build the '(request-target)' HTTP signature parameter. target_host = urlparse(self.configuration.host).netloc target_path = urlparse(self.configuration.host).path - request_target = method.lower() + " " + target_path + resource_path - if query_params: raw_query = urlencode(query_params).replace('+', '%20') request_target += "?" + raw_query @@ -606,9 +599,9 @@ class ApiClient(object): cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) created = now.strftime("%s") - signed_headers = {} - signed_header_dict = {} - for hdr_key in self.configuration.signed_headers: + signed_headers_dict = {} + request_headers_dict = {} + for hdr_key in self.configuration.signed_headers_dict: hdr_key = hdr_key.lower() if hdr_key == '(request-target)': value = request_target @@ -616,25 +609,51 @@ class ApiClient(object): value = created elif hdr_key == 'date': value = cdate - signed_header_dict['Date'] = '{0}'.format(cdate) + request_headers_dict['Date'] = '{0}'.format(cdate) elif hdr_key == 'digest': request_body = body.encode() body_digest, digest_prefix = self.get_message_digest(request_body) b64_body_digest = b64encode(body_digest.digest()) value = digest_prefix + b64_body_digest.decode('ascii') - signed_header_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) + request_headers_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) elif hdr_key == 'host': value = target_host - signed_header_dict['Host'] = '{0}'.format(target_host) + request_headers_dict['Host'] = '{0}'.format(target_host) else: value = headers[hdr_key] - signed_headers[hdr_key] = value + signed_headers_dict[hdr_key] = value + + # If the user has not provided any signed_headers, the default must be set to '(created)'. + if len(self.configuration.signed_headers_dict) == 0: + signed_headers_dict['(created)'] = created + + return signed_header_dict, request_headers_dict + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """ + Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + if body is None: + body = '' + else: + body = json.dumps(body) - if len(self.configuration.signed_headers) == 0: - signed_headers['(created)'] = created + signed_headers_dict, request_headers_dict = self.get_signed_header_info(self, + resource_path, method, headers, body, query_params) string_to_sign = "" - for i, (key, value) in enumerate(signed_headers.items()): + for i, (key, value) in enumerate(signed_headers_dict.items()): string_to_sign += "{0}: {1}".format(key.lower(), value) if i > 0: string_to_sign += "\n" @@ -642,10 +661,10 @@ class ApiClient(object): digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) b64_signed_msg = self.sign_digest(digest) - signed_header_dict['Authorization'] = self.get_authorization_header( - signed_headers, b64_signed_msg, created) + request_headers_dict['Authorization'] = self.get_authorization_header( + signed_headers_dict, b64_signed_msg, created) - return signed_header_dict + return request_headers_dict def get_message_digest(self, data): """ From 9d81bb715f34f082ceca0f623eddf9844f2e0b7b Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 06:18:05 -0800 Subject: [PATCH 036/102] fix python formatting issues --- .../python/python-experimental/api_client.mustache | 8 ++++---- .../python-experimental/petstore_api/api_client.py | 5 ++--- .../client/petstore/python/petstore_api/configuration.py | 7 ++++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 8e0b7cef2f74..4661dfa303d8 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -9,9 +9,9 @@ import os # python 2 and python 3 compatibility library import six -from six.moves.urllib.parse import quote, urlparse +from six.moves.urllib.parse import quote {{#hasHttpSignatureMethods}} -from six.moves.urllib.parse import urlencode +from six.moves.urllib.parse import urlencode, urlparse from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from Crypto.Hash import SHA256, SHA512 @@ -164,7 +164,7 @@ class ApiClient(object): # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body) # body if body: @@ -569,8 +569,8 @@ class ApiClient(object): raise ApiValueError( 'Authentication token must be in `query` or `header`' ) - {{#hasHttpSignatureMethods}} + def get_signed_header_info(self, resource_path, method, headers, body, query_params): """ Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index aca9349cbecd..bdfbd720d6d7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -17,7 +17,7 @@ # python 2 and python 3 compatibility library import six -from six.moves.urllib.parse import quote, urlparse +from six.moves.urllib.parse import quote from petstore_api import rest from petstore_api.configuration import Configuration @@ -158,7 +158,7 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body) # body if body: @@ -544,4 +544,3 @@ def update_params_for_auth(self, headers, querys, auth_settings, raise ApiValueError( 'Authentication token must be in `query` or `header`' ) - diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 150d76051a31..b63839851091 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -42,8 +42,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of HTTP headers that must be added to the signed message, - when signing HTTP requests. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be included in SignedHeaders. The '(created)' header expresses when the signature was created. @@ -124,7 +124,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ self.signed_headers = signed_headers - """A list of HTTP headers that must be signed, when signing HTTP requests. + """A list of strings. Each value is the name of HTTP header that must be included in the + HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer From c4c153085d122ab88923457911c8d9411573c317 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 09:30:47 -0800 Subject: [PATCH 037/102] fix trailing white space --- .../resources/python/python-experimental/api_client.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 4661dfa303d8..9dd6c0f73e36 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -539,7 +539,7 @@ class ApiClient(object): :param auth_settings: Authentication setting identifiers list. :resource_path: A string representation of the HTTP request resource path. :method: A string representation of the HTTP request method. - :body: A string representation of the body of the HTTP request. + :body: A string representation of the body of the HTTP request. """ if not auth_settings: return From c7a654e46b3750b57ad195ee0dc3033293720f06 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 09:49:26 -0800 Subject: [PATCH 038/102] address PR comments --- .../python/python-experimental/api_client.mustache | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 9dd6c0f73e36..e8ac6f59b8fd 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -585,6 +585,11 @@ class ApiClient(object): The second dict contains the HTTP headers that must be added to the outbound HTTP request. """ + if body is None: + body = '' + else: + body = json.dumps(body) + # Build the '(request-target)' HTTP signature parameter. target_host = urlparse(self.configuration.host).netloc target_path = urlparse(self.configuration.host).path @@ -644,10 +649,6 @@ class ApiClient(object): raise Exception("HTTP method must be set") if resource_path is None: raise Exception("Resource path must be set") - if body is None: - body = '' - else: - body = json.dumps(body) signed_headers_dict, request_headers_dict = self.get_signed_header_info(self, resource_path, method, headers, body, query_params) From 9b9d272ec7cff74b1fcb3c4d52e02a2e0d562cca Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 09:56:17 -0800 Subject: [PATCH 039/102] address PR comments --- .../python/python-experimental/api_client.mustache | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index e8ac6f59b8fd..faf83e53f991 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -663,7 +663,7 @@ class ApiClient(object): b64_signed_msg = self.sign_digest(digest) request_headers_dict['Authorization'] = self.get_authorization_header( - signed_headers_dict, b64_signed_msg, created) + signed_headers_dict, b64_signed_msg) return request_headers_dict @@ -716,15 +716,13 @@ class ApiClient(object): raise Exception("Unsupported private key: {0}".format(type(privkey))) return b64encode(signature) - def get_authorization_header(self, signed_headers, signed_msg, created_ts): + def get_authorization_header(self, signed_headers, signed_msg): """ Calculates and returns the value of the 'Authorization' header when signing HTTP requests. :param signed_headers : A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. :param signed_msg: A base-64 encoded string representation of the signature. - :param created_ts: The string representation of the time when the signature was created, - as a UNIX timestamp value. :return: The string value of the 'Authorization' header, representing the signature of the HTTP request. """ @@ -742,7 +740,7 @@ class ApiClient(object): auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," .format(self.configuration.key_id, self.configuration.signing_scheme) if is_created_set: - auth_str = auth_str + "created={0},".format(created_ts) + auth_str = auth_str + "created={0},".format(signed_headers_dict['(created)']) auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" .format(headers_value, signed_msg.decode('ascii')) return auth_str From 9c4c2fa6675e4fc397c92369ec47098d096ef5a1 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 09:58:45 -0800 Subject: [PATCH 040/102] address PR comments --- .../python/python-experimental/api_client.mustache | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index faf83e53f991..1b50e5e25e21 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -728,19 +728,17 @@ class ApiClient(object): """ headers_value = "" - is_created_set = False + created_ts = signed_headers.get('(created)') for i, key in enumerate(signed_headers) key = key.lower() headers_value += key if i > 0: headers_value += " " - if key == '(created)': - is_created_set = True auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," .format(self.configuration.key_id, self.configuration.signing_scheme) - if is_created_set: - auth_str = auth_str + "created={0},".format(signed_headers_dict['(created)']) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" .format(headers_value, signed_msg.decode('ascii')) return auth_str From 08557f48118f9972e4493dc73437cae66ac37dc8 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 10:24:42 -0800 Subject: [PATCH 041/102] Add suppport for '(expires)' signature parameter --- .../resources/python/configuration.mustache | 22 ++++++++++++++++--- .../python-experimental/api_client.mustache | 7 ++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 9f2933be8147..2a1c0ba59ca4 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -17,7 +17,7 @@ import urllib3 import six from six.moves import http_client as httplib - +from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -40,6 +40,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -63,13 +65,16 @@ class Configuration(object): password='the-password', ) - Configure API client with HTTP signature authentication: + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. conf = {{{packageName}}}.Configuration( key_id='my-key-id', private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + signature_max_validity=timedelta(minutes=5), ) """ @@ -77,7 +82,7 @@ class Configuration(object): api_key=None, api_key_prefix=None, username="", password="", key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signed_headers=None): + signing_algorithm=None, signature_max_validity=None, signed_headers=None): """Constructor """ self.host = host @@ -121,6 +126,17 @@ class Configuration(object): For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + """The signature max validity, expressed as a datetime.timedelta value. + It must be a positive value. + """ + if signed_headers is not None and '(expires)' in signed_headers: + if self.signature_max_validity is None: + raise Exception("Signature max validity must be set when '(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") self.signed_headers = signed_headers """A list of strings. Each value is the name of HTTP header that must be included in the HTTP signature calculation. diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 1b50e5e25e21..03bbc8837abe 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -603,6 +603,8 @@ class ApiClient(object): stamp = mktime(now.timetuple()) cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) created = now.strftime("%s") + if self.configuration.signature_max_validity is not None: + expires = (now + self.configuration.signature_max_validity).strftime("%s") signed_headers_dict = {} request_headers_dict = {} @@ -612,6 +614,8 @@ class ApiClient(object): value = request_target elif hdr_key == '(created)': value = created + elif hdr_key == '(expires)': + value = expires elif hdr_key == 'date': value = cdate request_headers_dict['Date'] = '{0}'.format(cdate) @@ -729,6 +733,7 @@ class ApiClient(object): headers_value = "" created_ts = signed_headers.get('(created)') + expires_ts = signed_headers.get('(expires)') for i, key in enumerate(signed_headers) key = key.lower() headers_value += key @@ -739,6 +744,8 @@ class ApiClient(object): .format(self.configuration.key_id, self.configuration.signing_scheme) if created_ts is not None: auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" .format(headers_value, signed_msg.decode('ascii')) return auth_str From 2eb626406ec9c8e539807b089987099f985a0269 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 10:28:20 -0800 Subject: [PATCH 042/102] address PR comments --- .../python/python-experimental/api_client.mustache | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 03bbc8837abe..3768b55111d6 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -657,11 +657,8 @@ class ApiClient(object): signed_headers_dict, request_headers_dict = self.get_signed_header_info(self, resource_path, method, headers, body, query_params) - string_to_sign = "" - for i, (key, value) in enumerate(signed_headers_dict.items()): - string_to_sign += "{0}: {1}".format(key.lower(), value) - if i > 0: - string_to_sign += "\n" + header_items = ["{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + string_to_sign = "\n".join(header_items) digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) b64_signed_msg = self.sign_digest(digest) @@ -734,11 +731,8 @@ class ApiClient(object): headers_value = "" created_ts = signed_headers.get('(created)') expires_ts = signed_headers.get('(expires)') - for i, key in enumerate(signed_headers) - key = key.lower() - headers_value += key - if i > 0: - headers_value += " " + lower_keys = [k.lower() for k in signed_headers] + headers_value = " ".join(lower_keys) auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," .format(self.configuration.key_id, self.configuration.signing_scheme) From 976b55b93009c6cdcdd71b8aa28597ff3cbe98a4 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 10:52:19 -0800 Subject: [PATCH 043/102] address PR comments --- .../src/main/resources/python/configuration.mustache | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 2a1c0ba59ca4..a9d347c2c26d 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -132,14 +132,16 @@ class Configuration(object): """The signature max validity, expressed as a datetime.timedelta value. It must be a positive value. """ - if signed_headers is not None and '(expires)' in signed_headers: - if self.signature_max_validity is None: - raise Exception("Signature max validity must be set when '(expires)' signature parameter is specified") + if self.signature_max_validity is None and \ + signed_headers is not None and '(expires)' in signed_headers: + raise Exception( + "Signature max validity must be set when " \ + "'(expires)' signature parameter is specified") if len(signed_headers) != len(set(signed_headers)): raise Exception("Cannot have duplicates in the signed_headers parameter") self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included in the - HTTP signature calculation. + """A list of strings. Each value is the name of HTTP header that must be included + in the HTTP signature calculation. """ {{#hasOAuthMethods}} self.access_token = "" From 05e60696f69f17e354062d7d1ab6534ce076d357 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 11:20:48 -0800 Subject: [PATCH 044/102] Fix python formatting issues --- .../petstore_api/api_client.py | 2 +- .../petstore_api/configuration.py | 28 +++++++++++++++---- .../petstore_api/models/animal.py | 6 ++-- .../petstore_api/models/array_test.py | 3 +- .../petstore_api/models/cat.py | 6 ++-- .../petstore_api/models/child.py | 6 ++-- .../petstore_api/models/child_cat.py | 6 ++-- .../petstore_api/models/child_dog.py | 6 ++-- .../petstore_api/models/child_lizard.py | 6 ++-- .../petstore_api/models/dog.py | 6 ++-- .../petstore_api/models/enum_test.py | 3 +- .../models/file_schema_test_class.py | 3 +- .../petstore_api/models/map_test.py | 3 +- ...perties_and_additional_properties_class.py | 3 +- .../petstore_api/models/outer_composite.py | 3 +- .../petstore_api/models/parent.py | 6 ++-- .../petstore_api/models/parent_pet.py | 12 +++++--- .../petstore_api/models/pet.py | 6 ++-- 18 files changed, 80 insertions(+), 34 deletions(-) diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index bdfbd720d6d7..7723fb3b87b9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -524,7 +524,7 @@ def update_params_for_auth(self, headers, querys, auth_settings, :param auth_settings: Authentication setting identifiers list. :resource_path: A string representation of the HTTP request resource path. :method: A string representation of the HTTP request method. - :body: A string representation of the body of the HTTP request. + :body: A string representation of the body of the HTTP request. """ if not auth_settings: return diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index ed76f9452296..2c6459e10eff 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -19,7 +19,7 @@ import six from six.moves import http_client as httplib - +from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -42,6 +42,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -65,13 +67,16 @@ class Configuration(object): password='the-password', ) - Configure API client with HTTP signature authentication: + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( key_id='my-key-id', private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + signature_max_validity=timedelta(minutes=5), ) """ @@ -79,7 +84,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signed_headers=None): + signing_algorithm=None, signature_max_validity=None, signed_headers=None): """Constructor """ self.host = host @@ -123,9 +128,22 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + """The signature max validity, expressed as a datetime.timedelta value. + It must be a positive value. + """ + if self.signature_max_validity is None and \ + signed_headers is not None and '(expires)' in signed_headers: + raise Exception( + "Signature max validity must be set when " \ + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included in the - HTTP signature calculation. + """A list of strings. Each value is the name of HTTP header that must be included + in the HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index 2da7a5923a5b..abb0d49e74c9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -31,11 +31,13 @@ try: from petstore_api.models import cat except ImportError: - cat = sys.modules['petstore_api.models.cat'] + cat = sys.modules[ + 'petstore_api.models.cat'] try: from petstore_api.models import dog except ImportError: - dog = sys.modules['petstore_api.models.dog'] + dog = sys.modules[ + 'petstore_api.models.dog'] class Animal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index 3c15d79a3d01..c99bc985cab1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import read_only_first except ImportError: - read_only_first = sys.modules['petstore_api.models.read_only_first'] + read_only_first = sys.modules[ + 'petstore_api.models.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 6b4985dc4a9b..229d04455540 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -31,11 +31,13 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import cat_all_of except ImportError: - cat_all_of = sys.modules['petstore_api.models.cat_all_of'] + cat_all_of = sys.modules[ + 'petstore_api.models.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/models/child.py index 8a61f35ba14b..9721a0b684f4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_all_of except ImportError: - child_all_of = sys.modules['petstore_api.models.child_all_of'] + child_all_of = sys.modules[ + 'petstore_api.models.child_all_of'] try: from petstore_api.models import parent except ImportError: - parent = sys.modules['petstore_api.models.parent'] + parent = sys.modules[ + 'petstore_api.models.parent'] class Child(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index b329281e9c25..7828dba8cb87 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_cat_all_of except ImportError: - child_cat_all_of = sys.modules['petstore_api.models.child_cat_all_of'] + child_cat_all_of = sys.modules[ + 'petstore_api.models.child_cat_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index eaea5cba93c8..36180f157134 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_dog_all_of except ImportError: - child_dog_all_of = sys.modules['petstore_api.models.child_dog_all_of'] + child_dog_all_of = sys.modules[ + 'petstore_api.models.child_dog_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildDog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index a038974bb543..cb79d4ad6048 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_lizard_all_of except ImportError: - child_lizard_all_of = sys.modules['petstore_api.models.child_lizard_all_of'] + child_lizard_all_of = sys.modules[ + 'petstore_api.models.child_lizard_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildLizard(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index 54ccf0e390ab..b29e31d4e5d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -31,11 +31,13 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import dog_all_of except ImportError: - dog_all_of = sys.modules['petstore_api.models.dog_all_of'] + dog_all_of = sys.modules[ + 'petstore_api.models.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 5df1bcbc2e7d..42a4c562150c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import outer_enum except ImportError: - outer_enum = sys.modules['petstore_api.models.outer_enum'] + outer_enum = sys.modules[ + 'petstore_api.models.outer_enum'] class EnumTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 62a9a4194a18..f1abb16cbc33 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -31,7 +31,8 @@ try: from petstore_api.models import file except ImportError: - file = sys.modules['petstore_api.models.file'] + file = sys.modules[ + 'petstore_api.models.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index e6680cc73493..e996e27991c1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import string_boolean_map except ImportError: - string_boolean_map = sys.modules['petstore_api.models.string_boolean_map'] + string_boolean_map = sys.modules[ + 'petstore_api.models.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 52969b942bfa..60b897624568 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -31,7 +31,8 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index 013e386adff8..067ac6a14007 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -31,7 +31,8 @@ try: from petstore_api.models import outer_number except ImportError: - outer_number = sys.modules['petstore_api.models.outer_number'] + outer_number = sys.modules[ + 'petstore_api.models.outer_number'] class OuterComposite(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/models/parent.py index 4175d7792f63..70534d8026eb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent.py @@ -31,11 +31,13 @@ try: from petstore_api.models import grandparent except ImportError: - grandparent = sys.modules['petstore_api.models.grandparent'] + grandparent = sys.modules[ + 'petstore_api.models.grandparent'] try: from petstore_api.models import parent_all_of except ImportError: - parent_all_of = sys.modules['petstore_api.models.parent_all_of'] + parent_all_of = sys.modules[ + 'petstore_api.models.parent_all_of'] class Parent(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index d98bdc6f6570..16d00f42da53 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -31,19 +31,23 @@ try: from petstore_api.models import child_cat except ImportError: - child_cat = sys.modules['petstore_api.models.child_cat'] + child_cat = sys.modules[ + 'petstore_api.models.child_cat'] try: from petstore_api.models import child_dog except ImportError: - child_dog = sys.modules['petstore_api.models.child_dog'] + child_dog = sys.modules[ + 'petstore_api.models.child_dog'] try: from petstore_api.models import child_lizard except ImportError: - child_lizard = sys.modules['petstore_api.models.child_lizard'] + child_lizard = sys.modules[ + 'petstore_api.models.child_lizard'] try: from petstore_api.models import grandparent_animal except ImportError: - grandparent_animal = sys.modules['petstore_api.models.grandparent_animal'] + grandparent_animal = sys.modules[ + 'petstore_api.models.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 83b4679eb7a3..11ffa6ff44f5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -31,11 +31,13 @@ try: from petstore_api.models import category except ImportError: - category = sys.modules['petstore_api.models.category'] + category = sys.modules[ + 'petstore_api.models.category'] try: from petstore_api.models import tag except ImportError: - tag = sys.modules['petstore_api.models.tag'] + tag = sys.modules[ + 'petstore_api.models.tag'] class Pet(ModelNormal): From dc5539122eb8aee30cc376119e2de463baf5b81e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 11:23:40 -0800 Subject: [PATCH 045/102] Fix python formatting issues --- .../petstore_api/configuration.py | 28 +++++++++++++++---- .../petstore_api/models/animal.py | 6 ++-- .../petstore_api/models/array_test.py | 3 +- .../petstore_api/models/cat.py | 6 ++-- .../petstore_api/models/child.py | 6 ++-- .../petstore_api/models/child_cat.py | 6 ++-- .../petstore_api/models/child_dog.py | 6 ++-- .../petstore_api/models/child_lizard.py | 6 ++-- .../petstore_api/models/dog.py | 6 ++-- .../petstore_api/models/enum_test.py | 3 +- .../models/file_schema_test_class.py | 3 +- .../petstore_api/models/map_test.py | 3 +- ...perties_and_additional_properties_class.py | 3 +- .../petstore_api/models/outer_composite.py | 3 +- .../petstore_api/models/parent.py | 6 ++-- .../petstore_api/models/parent_pet.py | 12 +++----- .../petstore_api/models/pet.py | 6 ++-- .../petstore_api/configuration.py | 28 +++++++++++++++---- .../python/petstore_api/configuration.py | 28 +++++++++++++++---- 19 files changed, 97 insertions(+), 71 deletions(-) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 32d0ed7304fa..366671df0fe1 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -18,7 +18,7 @@ import six from six.moves import http_client as httplib - +from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -41,6 +41,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -64,13 +66,16 @@ class Configuration(object): password='the-password', ) - Configure API client with HTTP signature authentication: + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( key_id='my-key-id', private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + signature_max_validity=timedelta(minutes=5), ) """ @@ -78,7 +83,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signed_headers=None): + signing_algorithm=None, signature_max_validity=None, signed_headers=None): """Constructor """ self.host = host @@ -122,9 +127,22 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + """The signature max validity, expressed as a datetime.timedelta value. + It must be a positive value. + """ + if self.signature_max_validity is None and \ + signed_headers is not None and '(expires)' in signed_headers: + raise Exception( + "Signature max validity must be set when " \ + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included in the - HTTP signature calculation. + """A list of strings. Each value is the name of HTTP header that must be included + in the HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index abb0d49e74c9..2da7a5923a5b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -31,13 +31,11 @@ try: from petstore_api.models import cat except ImportError: - cat = sys.modules[ - 'petstore_api.models.cat'] + cat = sys.modules['petstore_api.models.cat'] try: from petstore_api.models import dog except ImportError: - dog = sys.modules[ - 'petstore_api.models.dog'] + dog = sys.modules['petstore_api.models.dog'] class Animal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index c99bc985cab1..3c15d79a3d01 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -31,8 +31,7 @@ try: from petstore_api.models import read_only_first except ImportError: - read_only_first = sys.modules[ - 'petstore_api.models.read_only_first'] + read_only_first = sys.modules['petstore_api.models.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 229d04455540..6b4985dc4a9b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -31,13 +31,11 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules[ - 'petstore_api.models.animal'] + animal = sys.modules['petstore_api.models.animal'] try: from petstore_api.models import cat_all_of except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.models.cat_all_of'] + cat_all_of = sys.modules['petstore_api.models.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/models/child.py index 9721a0b684f4..8a61f35ba14b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_all_of except ImportError: - child_all_of = sys.modules[ - 'petstore_api.models.child_all_of'] + child_all_of = sys.modules['petstore_api.models.child_all_of'] try: from petstore_api.models import parent except ImportError: - parent = sys.modules[ - 'petstore_api.models.parent'] + parent = sys.modules['petstore_api.models.parent'] class Child(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index 7828dba8cb87..b329281e9c25 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_cat_all_of except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.models.child_cat_all_of'] + child_cat_all_of = sys.modules['petstore_api.models.child_cat_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + parent_pet = sys.modules['petstore_api.models.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index 36180f157134..eaea5cba93c8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_dog_all_of except ImportError: - child_dog_all_of = sys.modules[ - 'petstore_api.models.child_dog_all_of'] + child_dog_all_of = sys.modules['petstore_api.models.child_dog_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + parent_pet = sys.modules['petstore_api.models.parent_pet'] class ChildDog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index cb79d4ad6048..a038974bb543 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_lizard_all_of except ImportError: - child_lizard_all_of = sys.modules[ - 'petstore_api.models.child_lizard_all_of'] + child_lizard_all_of = sys.modules['petstore_api.models.child_lizard_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + parent_pet = sys.modules['petstore_api.models.parent_pet'] class ChildLizard(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index b29e31d4e5d5..54ccf0e390ab 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -31,13 +31,11 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules[ - 'petstore_api.models.animal'] + animal = sys.modules['petstore_api.models.animal'] try: from petstore_api.models import dog_all_of except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.models.dog_all_of'] + dog_all_of = sys.modules['petstore_api.models.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 42a4c562150c..5df1bcbc2e7d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -31,8 +31,7 @@ try: from petstore_api.models import outer_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.models.outer_enum'] + outer_enum = sys.modules['petstore_api.models.outer_enum'] class EnumTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index f1abb16cbc33..62a9a4194a18 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -31,8 +31,7 @@ try: from petstore_api.models import file except ImportError: - file = sys.modules[ - 'petstore_api.models.file'] + file = sys.modules['petstore_api.models.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index e996e27991c1..e6680cc73493 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -31,8 +31,7 @@ try: from petstore_api.models import string_boolean_map except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.models.string_boolean_map'] + string_boolean_map = sys.modules['petstore_api.models.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 60b897624568..52969b942bfa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -31,8 +31,7 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules[ - 'petstore_api.models.animal'] + animal = sys.modules['petstore_api.models.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index 067ac6a14007..013e386adff8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -31,8 +31,7 @@ try: from petstore_api.models import outer_number except ImportError: - outer_number = sys.modules[ - 'petstore_api.models.outer_number'] + outer_number = sys.modules['petstore_api.models.outer_number'] class OuterComposite(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/models/parent.py index 70534d8026eb..4175d7792f63 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent.py @@ -31,13 +31,11 @@ try: from petstore_api.models import grandparent except ImportError: - grandparent = sys.modules[ - 'petstore_api.models.grandparent'] + grandparent = sys.modules['petstore_api.models.grandparent'] try: from petstore_api.models import parent_all_of except ImportError: - parent_all_of = sys.modules[ - 'petstore_api.models.parent_all_of'] + parent_all_of = sys.modules['petstore_api.models.parent_all_of'] class Parent(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index 16d00f42da53..d98bdc6f6570 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -31,23 +31,19 @@ try: from petstore_api.models import child_cat except ImportError: - child_cat = sys.modules[ - 'petstore_api.models.child_cat'] + child_cat = sys.modules['petstore_api.models.child_cat'] try: from petstore_api.models import child_dog except ImportError: - child_dog = sys.modules[ - 'petstore_api.models.child_dog'] + child_dog = sys.modules['petstore_api.models.child_dog'] try: from petstore_api.models import child_lizard except ImportError: - child_lizard = sys.modules[ - 'petstore_api.models.child_lizard'] + child_lizard = sys.modules['petstore_api.models.child_lizard'] try: from petstore_api.models import grandparent_animal except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.models.grandparent_animal'] + grandparent_animal = sys.modules['petstore_api.models.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 11ffa6ff44f5..83b4679eb7a3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -31,13 +31,11 @@ try: from petstore_api.models import category except ImportError: - category = sys.modules[ - 'petstore_api.models.category'] + category = sys.modules['petstore_api.models.category'] try: from petstore_api.models import tag except ImportError: - tag = sys.modules[ - 'petstore_api.models.tag'] + tag = sys.modules['petstore_api.models.tag'] class Pet(ModelNormal): diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index ed76f9452296..2c6459e10eff 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -19,7 +19,7 @@ import six from six.moves import http_client as httplib - +from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -42,6 +42,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -65,13 +67,16 @@ class Configuration(object): password='the-password', ) - Configure API client with HTTP signature authentication: + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( key_id='my-key-id', private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + signature_max_validity=timedelta(minutes=5), ) """ @@ -79,7 +84,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signed_headers=None): + signing_algorithm=None, signature_max_validity=None, signed_headers=None): """Constructor """ self.host = host @@ -123,9 +128,22 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + """The signature max validity, expressed as a datetime.timedelta value. + It must be a positive value. + """ + if self.signature_max_validity is None and \ + signed_headers is not None and '(expires)' in signed_headers: + raise Exception( + "Signature max validity must be set when " \ + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included in the - HTTP signature calculation. + """A list of strings. Each value is the name of HTTP header that must be included + in the HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index ed76f9452296..2c6459e10eff 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -19,7 +19,7 @@ import six from six.moves import http_client as httplib - +from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -42,6 +42,8 @@ class Configuration(object): Supported value is hs2019. :param signing_algorithm: The signature algorithm, when signing HTTP requests. Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -65,13 +67,16 @@ class Configuration(object): password='the-password', ) - Configure API client with HTTP signature authentication: + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( key_id='my-key-id', private_key_path='rsa.pem', signing_scheme='hs2019', signing_algorithm='PSS', signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + signature_max_validity=timedelta(minutes=5), ) """ @@ -79,7 +84,7 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signed_headers=None): + signing_algorithm=None, signature_max_validity=None, signed_headers=None): """Constructor """ self.host = host @@ -123,9 +128,22 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", For RSA keys, supported values are PKCS1v15, PSS. For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. """ + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + """The signature max validity, expressed as a datetime.timedelta value. + It must be a positive value. + """ + if self.signature_max_validity is None and \ + signed_headers is not None and '(expires)' in signed_headers: + raise Exception( + "Signature max validity must be set when " \ + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included in the - HTTP signature calculation. + """A list of strings. Each value is the name of HTTP header that must be included + in the HTTP signature calculation. """ self.access_token = "" """access token for OAuth/Bearer From 959178a63fbe713196a6703e2774c6a8d5cfd2c4 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 11:37:34 -0800 Subject: [PATCH 046/102] Starting to move code to dedicated file for HTTP signatures --- .../python-experimental/api_client.mustache | 186 ---------------- .../python-experimental/signing.mustache | 204 ++++++++++++++++++ 2 files changed, 204 insertions(+), 186 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 3768b55111d6..1fef99bb7720 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -10,14 +10,6 @@ import os # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import quote -{{#hasHttpSignatureMethods}} -from six.moves.urllib.parse import urlencode, urlparse -from Crypto.PublicKey import RSA, ECC -from Crypto.Signature import PKCS1_v1_5, pss, DSS -from Crypto.Hash import SHA256, SHA512 -from base64 import b64encode -from email.utils import formatdate -{{/hasHttpSignatureMethods}} {{#tornado}} import tornado.gen {{/tornado}} @@ -65,9 +57,6 @@ class ApiClient(object): PRIMITIVE_TYPES = ( (float, bool, six.binary_type, six.text_type) + six.integer_types ) - ECDSA_MODE_FIPS_186_3 = 'fips-186-3' - ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' - ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} _pool = None @@ -569,178 +558,3 @@ class ApiClient(object): raise ApiValueError( 'Authentication token must be in `query` or `header`' ) -{{#hasHttpSignatureMethods}} - - def get_signed_header_info(self, resource_path, method, headers, body, query_params): - """ - Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A tuple containing two dict objects: - The first dict contains the HTTP headers that are used to calculate the HTTP signature. - The second dict contains the HTTP headers that must be added to the outbound HTTP request. - """ - - if body is None: - body = '' - else: - body = json.dumps(body) - - # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(self.configuration.host).netloc - target_path = urlparse(self.configuration.host).path - request_target = method.lower() + " " + target_path + resource_path - if query_params: - raw_query = urlencode(query_params).replace('+', '%20') - request_target += "?" + raw_query - - # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. - now = datetime.datetime.now() - stamp = mktime(now.timetuple()) - cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) - created = now.strftime("%s") - if self.configuration.signature_max_validity is not None: - expires = (now + self.configuration.signature_max_validity).strftime("%s") - - signed_headers_dict = {} - request_headers_dict = {} - for hdr_key in self.configuration.signed_headers_dict: - hdr_key = hdr_key.lower() - if hdr_key == '(request-target)': - value = request_target - elif hdr_key == '(created)': - value = created - elif hdr_key == '(expires)': - value = expires - elif hdr_key == 'date': - value = cdate - request_headers_dict['Date'] = '{0}'.format(cdate) - elif hdr_key == 'digest': - request_body = body.encode() - body_digest, digest_prefix = self.get_message_digest(request_body) - b64_body_digest = b64encode(body_digest.digest()) - value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) - elif hdr_key == 'host': - value = target_host - request_headers_dict['Host'] = '{0}'.format(target_host) - else: - value = headers[hdr_key] - signed_headers_dict[hdr_key] = value - - # If the user has not provided any signed_headers, the default must be set to '(created)'. - if len(self.configuration.signed_headers_dict) == 0: - signed_headers_dict['(created)'] = created - - return signed_header_dict, request_headers_dict - - def get_http_signature_headers(self, resource_path, method, headers, body, query_params): - """ - Create a cryptographic message signature for the HTTP request and add the signed headers. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A dict of HTTP headers that must be added to the outbound HTTP request. - """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - - signed_headers_dict, request_headers_dict = self.get_signed_header_info(self, - resource_path, method, headers, body, query_params) - - header_items = ["{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] - string_to_sign = "\n".join(header_items) - - digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) - b64_signed_msg = self.sign_digest(digest) - - request_headers_dict['Authorization'] = self.get_authorization_header( - signed_headers_dict, b64_signed_msg) - - return request_headers_dict - - def get_message_digest(self, data): - """ - Calculates and returns a cryptographic digest of a specified HTTP request. - - :param data: The string representation of the date to be hashed with a cryptographic hash. - :return: A tuple of (digest, prefix). - The digest is a hashing object that contains the cryptographic digest of the HTTP request. - The prefix is a string that identifies the cryptographc hash. It is used to generate the - 'Digest' header as specified in RFC 3230. - """ - if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: - digest = SHA512.new() - prefix = "SHA-512=" - elif self.configuration.signing_scheme in ["rsa-sha256"]: - digest = SHA256.new() - prefix = "SHA-256=" - else: - raise Exception( - "Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) - digest.update(data) - return digest, prefix - - def sign_digest(self, digest): - """ - Signs a message digest with a private key specified in the configuration. - - :param digest: A hashing object that contains the cryptographic digest of the HTTP request. - :return: A base-64 string representing the cryptographic signature of the input digest. - """ - self.configuration.load_private_key() - privkey = self.configuration.private_key - if isinstance(privkey, RSA.RsaKey): - if self.configuration.signing_algorithm == 'PSS': - # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(privkey).sign(digest) - elif self.configuration.signing_algorithm == 'PKCS1v15': - # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(privkey).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) - elif isinstance(privkey, ECC.EccKey): - if self.configuration.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: - signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) - else: - raise Exception("Unsupported private key: {0}".format(type(privkey))) - return b64encode(signature) - - def get_authorization_header(self, signed_headers, signed_msg): - """ - Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param signed_headers : A list of strings. Each value is the name of a HTTP header that - must be included in the HTTP signature calculation. - :param signed_msg: A base-64 encoded string representation of the signature. - :return: The string value of the 'Authorization' header, representing the signature - of the HTTP request. - """ - - headers_value = "" - created_ts = signed_headers.get('(created)') - expires_ts = signed_headers.get('(expires)') - lower_keys = [k.lower() for k in signed_headers] - headers_value = " ".join(lower_keys) - - auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," - .format(self.configuration.key_id, self.configuration.signing_scheme) - if created_ts is not None: - auth_str = auth_str + "created={0},".format(created_ts) - if expires_ts is not None: - auth_str = auth_str + "expires={0},".format(expires_ts) - auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" - .format(headers_value, signed_msg.decode('ascii')) - return auth_str -{{/hasHttpSignatureMethods}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache new file mode 100644 index 000000000000..91a493340a78 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -0,0 +1,204 @@ +{{#hasHttpSignatureMethods}} +# coding: utf-8 +{{>partial_header}} +from __future__ import absolute_import + +from six.moves.urllib.parse import urlencode, urlparse +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from Crypto.Hash import SHA256, SHA512 +from base64 import b64encode +from email.utils import formatdate + +class HttpSignatureHandler(object): + """OpenAPI HTTP signature handler to generate and verify HTTP signatures. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + """ + + ECDSA_MODE_FIPS_186_3 = 'fips-186-3' + ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' + ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} + + def __init__(self, configuration=None): + if configuration is None: + raise Exception("Configuration must be specified") + self.configuration = configuration + + def get_signed_header_info(self, resource_path, method, headers, body, query_params): + """ + Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate the HTTP signature. + The second dict contains the HTTP headers that must be added to the outbound HTTP request. + """ + + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(self.configuration.host).netloc + target_path = urlparse(self.configuration.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query + + # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. + now = datetime.datetime.now() + stamp = mktime(now.timetuple()) + cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) + created = now.strftime("%s") + if self.configuration.signature_max_validity is not None: + expires = (now + self.configuration.signature_max_validity).strftime("%s") + + signed_headers_dict = {} + request_headers_dict = {} + for hdr_key in self.configuration.signed_headers_dict: + hdr_key = hdr_key.lower() + if hdr_key == '(request-target)': + value = request_target + elif hdr_key == '(created)': + value = created + elif hdr_key == '(expires)': + value = expires + elif hdr_key == 'date': + value = cdate + request_headers_dict['Date'] = '{0}'.format(cdate) + elif hdr_key == 'digest': + request_body = body.encode() + body_digest, digest_prefix = self.get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == 'host': + value = target_host + request_headers_dict['Host'] = '{0}'.format(target_host) + else: + value = headers[hdr_key] + signed_headers_dict[hdr_key] = value + + # If the user has not provided any signed_headers, the default must be set to '(created)'. + if len(self.configuration.signed_headers_dict) == 0: + signed_headers_dict['(created)'] = created + + return signed_header_dict, request_headers_dict + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """ + Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_dict, request_headers_dict = self.get_signed_header_info(self, + resource_path, method, headers, body, query_params) + + header_items = ["{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) + b64_signed_msg = self.sign_digest(digest) + + request_headers_dict['Authorization'] = self.get_authorization_header( + signed_headers_dict, b64_signed_msg) + + return request_headers_dict + + def get_message_digest(self, data): + """ + Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used to generate the + 'Digest' header as specified in RFC 3230. + """ + if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: + digest = SHA512.new() + prefix = "SHA-512=" + elif self.configuration.signing_scheme in ["rsa-sha256"]: + digest = SHA256.new() + prefix = "SHA-256=" + else: + raise Exception( + "Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) + digest.update(data) + return digest, prefix + + def sign_digest(self, digest): + """ + Signs a message digest with a private key specified in the configuration. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + self.configuration.load_private_key() + privkey = self.configuration.private_key + if isinstance(privkey, RSA.RsaKey): + if self.configuration.signing_algorithm == 'PSS': + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(privkey).sign(digest) + elif self.configuration.signing_algorithm == 'PKCS1v15': + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(privkey).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + elif isinstance(privkey, ECC.EccKey): + if self.configuration.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + else: + raise Exception("Unsupported private key: {0}".format(type(privkey))) + return b64encode(signature) + + def get_authorization_header(self, signed_headers, signed_msg): + """ + Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of strings. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + + headers_value = "" + created_ts = signed_headers.get('(created)') + expires_ts = signed_headers.get('(expires)') + lower_keys = [k.lower() for k in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," + .format(self.configuration.key_id, self.configuration.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" + .format(headers_value, signed_msg.decode('ascii')) + return auth_str +{{/hasHttpSignatureMethods}} From 277e48978c58712538cec73939bae8efc9fca4f1 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 12:44:44 -0800 Subject: [PATCH 047/102] Continue to refactor code to dedicated file for HTTP signatures --- .../PythonClientExperimentalCodegen.java | 3 + .../resources/python/configuration.mustache | 39 +- .../python-experimental/api_client.mustache | 7 +- .../python-experimental/signing.mustache | 390 +++++++++--------- 4 files changed, 218 insertions(+), 221 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 5d8d9089dba7..737f519babcc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -106,6 +106,9 @@ public void processOpts() { supportingFiles.remove(new SupportingFile("api_client.mustache", packagePath(), "api_client.py")); supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py")); + if (hasHttpSignatureMethods(this.authMethods)) { + supportingFiles.add(new SupportingFile("python-experimental/signing.mustache", packagePath(), "signing.py")); + } supportingFiles.add(new SupportingFile("python-experimental/model_utils.mustache", packagePath(), "model_utils.py")); diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index a9d347c2c26d..5c61804f0d2f 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -8,10 +8,6 @@ import logging {{^asyncio}} import multiprocessing {{/asyncio}} -{{#hasHttpSignatureMethods}} -import pem -from Crypto.PublicKey import RSA, ECC -{{/hasHttpSignatureMethods}} import sys import urllib3 @@ -71,9 +67,11 @@ class Configuration(object): conf = {{{packageName}}}.Configuration( key_id='my-key-id', private_key_path='rsa.pem', - signing_scheme='hs2019', - signing_algorithm='PSS', - signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + signing_scheme=signing.SCHEME_HS2019, + signing_algorithm=signing.ALGORITHM_RSASSA_PSS, + signed_headers=[signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, + signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, + signing.HEADER_DIGEST, 'Content-Type'] signature_max_validity=timedelta(minutes=5), ) """ @@ -193,12 +191,10 @@ class Configuration(object): self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ -{{#hasHttpSignatureMethods}} self.private_key = None """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. + Initialized when the PEM-encoded private key is loaded from a file. """ -{{/hasHttpSignatureMethods}} {{#asyncio}} self.connection_pool_maxsize = 100 @@ -400,29 +396,6 @@ class Configuration(object): {{/isOAuth}} {{/authMethods}} } -{{#hasHttpSignatureMethods}} - - def load_private_key(self): - """Load the private key used to sign HTTP requests. - The private key is used to sign HTTP requests as defined in - https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. - """ - if self.private_key is not None: - return - with open(self.private_key_path, "rb") as f: - # Decode PEM file and determine key type from PEM header. - # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". - keys = pem.parse(f.read()) - if len(keys) != 1: - raise Exception("File must contain exactly one private key") - key = keys[0].as_text() - if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): - self.private_key = RSA.importKey(key) - elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): - self.private_key = ECC.importKey(key) - else: - raise Exception("Unsupported key") -{{/hasHttpSignatureMethods}} def to_debug_report(self): """Gets the essential information for debugging. diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 1fef99bb7720..0a3a557031f5 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -13,6 +13,9 @@ from six.moves.urllib.parse import quote {{#tornado}} import tornado.gen {{/tornado}} +{{#hasHttpSignatureMethods}} +import signing +{{/hasHttpSignatureMethods}} from {{packageName}} import rest from {{packageName}}.configuration import Configuration @@ -540,8 +543,8 @@ class ApiClient(object): if auth_setting['type'] == 'http-signature': # The HTTP signature scheme requires multiple HTTP headers # that are calculated dynamically. - auth_headers = self.get_http_signature_headers(resource_path, method, - headers, body, querys) + auth_headers = signing.get_http_signature_headers(self.configuration, + resource_path, method, headers, body, querys) for key, value in auth_headers.items(): headers[key] = value continue diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 91a493340a78..b7f4e85f73f3 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -1,204 +1,222 @@ -{{#hasHttpSignatureMethods}} # coding: utf-8 {{>partial_header}} from __future__ import absolute_import from six.moves.urllib.parse import urlencode, urlparse +import pem from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from Crypto.Hash import SHA256, SHA512 from base64 import b64encode from email.utils import formatdate -class HttpSignatureHandler(object): - """OpenAPI HTTP signature handler to generate and verify HTTP signatures. +HEADER_REQUEST_TARGET = '(request-target)' +HEADER_CREATED = '(created)' +HEADER_EXPIRES = '(expires)' +HEADER_HOST = 'host' +HEADER_DATE = 'date' +HEADER_DIGEST = 'Digest' - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. +SCHEME_HS2019 = 'hs2019' - :param configuration: .Configuration object for this client +ALGORITHM_RSASSA_PSS = 'PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'PKCS1v15' + +ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' +ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} + +def get_http_signature_headers(configuration, resource_path, method, headers, body, query_params): + """ + Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_dict, request_headers_dict = get_signed_header_info(configuration, + resource_path, method, headers, body, query_params) + + header_items = ["{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = get_message_digest(configuration, string_to_sign.encode()) + b64_signed_msg = sign_digest(configuration, digest) + + request_headers_dict['Authorization'] = get_authorization_header(configuration, + signed_headers_dict, b64_signed_msg) + + return request_headers_dict + +def load_private_key(configuration): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if configuration.private_key is not None: + return + with open(configuration.private_key_path, "rb") as f: + # Decode PEM file and determine key type from PEM header. + # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". + keys = pem.parse(f.read()) + if len(keys) != 1: + raise Exception("File must contain exactly one private key") + key = keys[0].as_text() + if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): + configuration.private_key = RSA.importKey(key) + elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): + configuration.private_key = ECC.importKey(key) + else: + raise Exception("Unsupported key") + +def get_signed_header_info(configuration, resource_path, method, headers, body, query_params): + """ + Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate the HTTP signature. + The second dict contains the HTTP headers that must be added to the outbound HTTP request. """ - ECDSA_MODE_FIPS_186_3 = 'fips-186-3' - ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' - ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} - - def __init__(self, configuration=None): - if configuration is None: - raise Exception("Configuration must be specified") - self.configuration = configuration - - def get_signed_header_info(self, resource_path, method, headers, body, query_params): - """ - Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A tuple containing two dict objects: - The first dict contains the HTTP headers that are used to calculate the HTTP signature. - The second dict contains the HTTP headers that must be added to the outbound HTTP request. - """ - - if body is None: - body = '' + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(configuration.host).netloc + target_path = urlparse(configuration.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query + + # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. + now = datetime.datetime.now() + stamp = mktime(now.timetuple()) + cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) + created = now.strftime("%s") + if configuration.signature_max_validity is not None: + expires = (now + configuration.signature_max_validity).strftime("%s") + + signed_headers_dict = {} + request_headers_dict = {} + for hdr_key in configuration.signed_headers_dict: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = created + elif hdr_key == HEADER_EXPIRES: + value = expires + elif hdr_key == HEADER_DATE: + value = cdate + request_headers_dict['Date'] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST: + request_body = body.encode() + body_digest, digest_prefix = get_message_digest(configuration, request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST: + value = target_host + request_headers_dict['Host'] = '{0}'.format(target_host) else: - body = json.dumps(body) - - # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(self.configuration.host).netloc - target_path = urlparse(self.configuration.host).path - request_target = method.lower() + " " + target_path + resource_path - if query_params: - raw_query = urlencode(query_params).replace('+', '%20') - request_target += "?" + raw_query - - # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. - now = datetime.datetime.now() - stamp = mktime(now.timetuple()) - cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) - created = now.strftime("%s") - if self.configuration.signature_max_validity is not None: - expires = (now + self.configuration.signature_max_validity).strftime("%s") - - signed_headers_dict = {} - request_headers_dict = {} - for hdr_key in self.configuration.signed_headers_dict: - hdr_key = hdr_key.lower() - if hdr_key == '(request-target)': - value = request_target - elif hdr_key == '(created)': - value = created - elif hdr_key == '(expires)': - value = expires - elif hdr_key == 'date': - value = cdate - request_headers_dict['Date'] = '{0}'.format(cdate) - elif hdr_key == 'digest': - request_body = body.encode() - body_digest, digest_prefix = self.get_message_digest(request_body) - b64_body_digest = b64encode(body_digest.digest()) - value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) - elif hdr_key == 'host': - value = target_host - request_headers_dict['Host'] = '{0}'.format(target_host) - else: - value = headers[hdr_key] - signed_headers_dict[hdr_key] = value - - # If the user has not provided any signed_headers, the default must be set to '(created)'. - if len(self.configuration.signed_headers_dict) == 0: - signed_headers_dict['(created)'] = created - - return signed_header_dict, request_headers_dict - - def get_http_signature_headers(self, resource_path, method, headers, body, query_params): - """ - Create a cryptographic message signature for the HTTP request and add the signed headers. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A dict of HTTP headers that must be added to the outbound HTTP request. - """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - - signed_headers_dict, request_headers_dict = self.get_signed_header_info(self, - resource_path, method, headers, body, query_params) - - header_items = ["{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] - string_to_sign = "\n".join(header_items) - - digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) - b64_signed_msg = self.sign_digest(digest) - - request_headers_dict['Authorization'] = self.get_authorization_header( - signed_headers_dict, b64_signed_msg) - - return request_headers_dict - - def get_message_digest(self, data): - """ - Calculates and returns a cryptographic digest of a specified HTTP request. - - :param data: The string representation of the date to be hashed with a cryptographic hash. - :return: A tuple of (digest, prefix). - The digest is a hashing object that contains the cryptographic digest of the HTTP request. - The prefix is a string that identifies the cryptographc hash. It is used to generate the - 'Digest' header as specified in RFC 3230. - """ - if self.configuration.signing_scheme in ["rsa-sha512", "hs2019"]: - digest = SHA512.new() - prefix = "SHA-512=" - elif self.configuration.signing_scheme in ["rsa-sha256"]: - digest = SHA256.new() - prefix = "SHA-256=" + value = headers[hdr_key] + signed_headers_dict[hdr_key] = value + + # If the user has not provided any signed_headers, the default must be set to '(created)'. + if len(configuration.signed_headers_dict) == 0: + signed_headers_dict[HEADER_CREATED] = created + + return signed_header_dict, request_headers_dict + +def get_message_digest(configuration, data): + """ + Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used to generate the + 'Digest' header as specified in RFC 3230. + """ + if configuration.signing_scheme in ["rsa-sha512", "hs2019"]: + digest = SHA512.new() + prefix = "SHA-512=" + elif configuration.signing_scheme in ["rsa-sha256"]: + digest = SHA256.new() + prefix = "SHA-256=" + else: + raise Exception( + "Unsupported signing algorithm: {0}".format(configuration.signing_scheme)) + digest.update(data) + return digest, prefix + +def sign_digest(configuration, digest): + """ + Signs a message digest with a private key specified in the configuration. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + load_private_key(configuration) + privkey = self.private_key + if isinstance(privkey, RSA.RsaKey): + if configuration.signing_algorithm == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(privkey).sign(digest) + elif configuration.signing_algorithm == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(privkey).sign(digest) else: - raise Exception( - "Unsupported signing algorithm: {0}".format(self.configuration.signing_scheme)) - digest.update(data) - return digest, prefix - - def sign_digest(self, digest): - """ - Signs a message digest with a private key specified in the configuration. - - :param digest: A hashing object that contains the cryptographic digest of the HTTP request. - :return: A base-64 string representing the cryptographic signature of the input digest. - """ - self.configuration.load_private_key() - privkey = self.configuration.private_key - if isinstance(privkey, RSA.RsaKey): - if self.configuration.signing_algorithm == 'PSS': - # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(privkey).sign(digest) - elif self.configuration.signing_algorithm == 'PKCS1v15': - # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(privkey).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) - elif isinstance(privkey, ECC.EccKey): - if self.configuration.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: - signature = DSS.new(privkey, self.configuration.signing_algorithm).sign(digest) - else: - raise Exception("Unsupported signature algorithm: {0}".format(self.configuration.signing_algorithm)) + raise Exception("Unsupported signature algorithm: {0}".format(configuration.signing_algorithm)) + elif isinstance(privkey, ECC.EccKey): + if configuration.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(privkey, configuration.signing_algorithm).sign(digest) else: - raise Exception("Unsupported private key: {0}".format(type(privkey))) - return b64encode(signature) - - def get_authorization_header(self, signed_headers, signed_msg): - """ - Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param signed_headers : A list of strings. Each value is the name of a HTTP header that - must be included in the HTTP signature calculation. - :param signed_msg: A base-64 encoded string representation of the signature. - :return: The string value of the 'Authorization' header, representing the signature - of the HTTP request. - """ - - headers_value = "" - created_ts = signed_headers.get('(created)') - expires_ts = signed_headers.get('(expires)') - lower_keys = [k.lower() for k in signed_headers] - headers_value = " ".join(lower_keys) - - auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," - .format(self.configuration.key_id, self.configuration.signing_scheme) - if created_ts is not None: - auth_str = auth_str + "created={0},".format(created_ts) - if expires_ts is not None: - auth_str = auth_str + "expires={0},".format(expires_ts) - auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" - .format(headers_value, signed_msg.decode('ascii')) - return auth_str -{{/hasHttpSignatureMethods}} + raise Exception("Unsupported signature algorithm: {0}".format(configuration.signing_algorithm)) + else: + raise Exception("Unsupported private key: {0}".format(type(privkey))) + return b64encode(signature) + +def get_authorization_header(configuration, signed_headers, signed_msg): + """ + Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of strings. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + + headers_value = "" + created_ts = signed_headers.get(HEADER_CREATED) + expires_ts = signed_headers.get(HEADER_EXPIRES) + lower_keys = [k.lower() for k in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," + .format(configuration.key_id, configuration.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" + .format(headers_value, signed_msg.decode('ascii')) + return auth_str + From 7fb18e2e0c33a60fc6b760f2e202d0bce1a50dd3 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 12:57:00 -0800 Subject: [PATCH 048/102] Continue to refactor code to dedicated file for HTTP signatures --- .../codegen/languages/PythonClientExperimentalCodegen.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 737f519babcc..54cb42268bf8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -82,6 +82,9 @@ public PythonClientExperimentalCodegen() { apiTemplateFiles.remove("api.mustache"); apiTemplateFiles.put("python-experimental/api.mustache", ".py"); + if (hasHttpSignatureMethods(this.authMethods)) { + apiTemplateFiles.put("python-experimental/signing.mustache", ".py"); + } apiDocTemplateFiles.remove("api_doc.mustache"); apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md"); @@ -106,9 +109,6 @@ public void processOpts() { supportingFiles.remove(new SupportingFile("api_client.mustache", packagePath(), "api_client.py")); supportingFiles.add(new SupportingFile("python-experimental/api_client.mustache", packagePath(), "api_client.py")); - if (hasHttpSignatureMethods(this.authMethods)) { - supportingFiles.add(new SupportingFile("python-experimental/signing.mustache", packagePath(), "signing.py")); - } supportingFiles.add(new SupportingFile("python-experimental/model_utils.mustache", packagePath(), "model_utils.py")); From 071316439675ee55efb3682ecd2e7d666a52cd94 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 13:17:42 -0800 Subject: [PATCH 049/102] Continue to refactor code to dedicated file for HTTP signatures --- .../codegen/languages/PythonClientExperimentalCodegen.java | 2 +- .../main/resources/python/python-experimental/signing.mustache | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 54cb42268bf8..e502f1de1662 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -82,7 +82,7 @@ public PythonClientExperimentalCodegen() { apiTemplateFiles.remove("api.mustache"); apiTemplateFiles.put("python-experimental/api.mustache", ".py"); - if (hasHttpSignatureMethods(this.authMethods)) { + if (hasHttpSignatureMethods(this.fullAuthMethods)) { apiTemplateFiles.put("python-experimental/signing.mustache", ".py"); } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index b7f4e85f73f3..092c33234605 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -219,4 +219,3 @@ def get_authorization_header(configuration, signed_headers, signed_msg): auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" .format(headers_value, signed_msg.decode('ascii')) return auth_str - From 719146d165cb10b8ad9b32a82c34e929c41ed6d3 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 14:03:10 -0800 Subject: [PATCH 050/102] Continue to refactor code to dedicated file for HTTP signatures --- .../python/python-experimental/api_client.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 0a3a557031f5..f20c4355174d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -13,11 +13,11 @@ from six.moves.urllib.parse import quote {{#tornado}} import tornado.gen {{/tornado}} -{{#hasHttpSignatureMethods}} -import signing -{{/hasHttpSignatureMethods}} from {{packageName}} import rest +{{#hasHttpSignatureMethods}} +from {{packageName}} import signing +{{/hasHttpSignatureMethods}} from {{packageName}}.configuration import Configuration from {{packageName}}.exceptions import ApiValueError from {{packageName}}.model_utils import ( From 31519820f6e0a8a06805d6a84a9dfaa17eb122eb Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 15:13:21 -0800 Subject: [PATCH 051/102] move method to ProcessUtils --- .../openapitools/codegen/DefaultGenerator.java | 16 ++-------------- .../codegen/utils/ProcessUtils.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 161a136b7e06..d1cc734c4cfc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -42,6 +42,7 @@ import org.openapitools.codegen.templating.MustacheEngineAdapter; import org.openapitools.codegen.utils.ImplementationVersion; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -851,7 +852,7 @@ private Map buildSupportFileBundle(List allOperations, L if (hasBearerMethods(authMethods)) { bundle.put("hasBearerMethods", true); } - if (hasHttpSignatureMethods(authMethods)) { + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { bundle.put("hasHttpSignatureMethods", true); } } @@ -1335,19 +1336,6 @@ private boolean hasBearerMethods(List authMethods) { return false; } - // hasHttpSignatureMethods returns true if the specified OAS model has - // HTTP signature methods. - // The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - private boolean hasHttpSignatureMethods(List authMethods) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isHttpSignature)) { - return true; - } - } - - return false; - } - private List getOAuthMethods(List authMethods) { List oauthMethods = new ArrayList<>(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java index c2d7859ecb29..499c1d55308a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java @@ -94,4 +94,22 @@ public static boolean hasBearerMethods(Map objs) { return false; } + /** + * Returns true if the specified OAS model has at least one operation with the HTTP signature + * security scheme. + * The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + * + * @param authMethods List of auth methods. + * @return True if at least one operation has HTTP signature security schema defined + */ + public static boolean hasHttpSignatureMethods(List authMethods) { + if (authMethods != null && !authMethods.isEmpty()) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isHttpSignature)) { + return true; + } + } + } + return false; + } } From 6fd84329220997e6a77c82d5bc56c3036fa5f1c8 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 15:13:46 -0800 Subject: [PATCH 052/102] conditionally build signing.py --- .../codegen/languages/PythonClientExperimentalCodegen.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index e502f1de1662..e1958d0485d9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -25,12 +25,14 @@ import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.parameters.RequestBody; import io.swagger.v3.oas.models.responses.ApiResponse; +import io.swagger.v3.oas.models.security.SecurityScheme; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; import org.openapitools.codegen.examples.ExampleGenerator; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.meta.GeneratorMetadata; import org.openapitools.codegen.meta.Stability; import org.slf4j.Logger; @@ -82,7 +84,10 @@ public PythonClientExperimentalCodegen() { apiTemplateFiles.remove("api.mustache"); apiTemplateFiles.put("python-experimental/api.mustache", ".py"); - if (hasHttpSignatureMethods(this.fullAuthMethods)) { + Map securitySchemeMap = openAPI != null ? + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + List authMethods = fromSecurity(securitySchemeMap); + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { apiTemplateFiles.put("python-experimental/signing.mustache", ".py"); } From bb124210a23ff595c191e0230c6b35ab86476aa5 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 15:13:21 -0800 Subject: [PATCH 053/102] move method to ProcessUtils --- .../openapitools/codegen/DefaultGenerator.java | 16 ++-------------- .../codegen/utils/ProcessUtils.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 161a136b7e06..d1cc734c4cfc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -42,6 +42,7 @@ import org.openapitools.codegen.templating.MustacheEngineAdapter; import org.openapitools.codegen.utils.ImplementationVersion; import org.openapitools.codegen.utils.ModelUtils; +import org.openapitools.codegen.utils.ProcessUtils; import org.openapitools.codegen.utils.URLPathUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -851,7 +852,7 @@ private Map buildSupportFileBundle(List allOperations, L if (hasBearerMethods(authMethods)) { bundle.put("hasBearerMethods", true); } - if (hasHttpSignatureMethods(authMethods)) { + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { bundle.put("hasHttpSignatureMethods", true); } } @@ -1335,19 +1336,6 @@ private boolean hasBearerMethods(List authMethods) { return false; } - // hasHttpSignatureMethods returns true if the specified OAS model has - // HTTP signature methods. - // The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - private boolean hasHttpSignatureMethods(List authMethods) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isHttpSignature)) { - return true; - } - } - - return false; - } - private List getOAuthMethods(List authMethods) { List oauthMethods = new ArrayList<>(); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java index c2d7859ecb29..499c1d55308a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java @@ -94,4 +94,22 @@ public static boolean hasBearerMethods(Map objs) { return false; } + /** + * Returns true if the specified OAS model has at least one operation with the HTTP signature + * security scheme. + * The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + * + * @param authMethods List of auth methods. + * @return True if at least one operation has HTTP signature security schema defined + */ + public static boolean hasHttpSignatureMethods(List authMethods) { + if (authMethods != null && !authMethods.isEmpty()) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isHttpSignature)) { + return true; + } + } + } + return false; + } } From 7c1967eff0cfe4f2099120ae0f39ff77d04f2ec1 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 17:00:30 -0800 Subject: [PATCH 054/102] Code reformatting --- .../java/org/openapitools/codegen/CodegenSecurity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java index 62b456803746..809ce85a9643 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenSecurity.java @@ -31,7 +31,8 @@ public class CodegenSecurity { public Boolean hasMore, isBasic, isOAuth, isApiKey; // is Basic is true for all http authentication type. // Those are to differentiate basic and bearer authentication - // isHttpSignature is to support https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + // isHttpSignature is to support HTTP signature authorization scheme. + // https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ public Boolean isBasicBasic, isBasicBearer, isHttpSignature; public String bearerFormat; public Map vendorExtensions = new HashMap(); @@ -121,8 +122,9 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, isBasicBasic, isHttpSignature, isBasicBearer, - bearerFormat, vendorExtensions, keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow, + return Objects.hash(name, type, scheme, hasMore, isBasic, isOAuth, isApiKey, + isBasicBasic, isHttpSignature, isBasicBearer, bearerFormat, vendorExtensions, + keyParamName, isKeyInQuery, isKeyInHeader, isKeyInCookie, flow, authorizationUrl, tokenUrl, scopes, isCode, isPassword, isApplication, isImplicit); } From de9124c071ad7793d5eaeacd1df7224b408e2762 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 20:27:51 -0800 Subject: [PATCH 055/102] externalize http signature configuration --- .../resources/python/configuration.mustache | 154 ++++++++++-------- .../python-experimental/signing.mustache | 57 ++++--- 2 files changed, 123 insertions(+), 88 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 5c61804f0d2f..219afea0dce9 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -26,32 +26,8 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, - when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of {{{packageName}}}.HttpSigningConfiguration :Example: @@ -65,22 +41,23 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = {{{packageName}}}.Configuration( - key_id='my-key-id', - private_key_path='rsa.pem', - signing_scheme=signing.SCHEME_HS2019, - signing_algorithm=signing.ALGORITHM_RSASSA_PSS, - signed_headers=[signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, - signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, - signing.HEADER_DIGEST, 'Content-Type'] - signature_max_validity=timedelta(minutes=5), + signing_info = {{{packageName}}}.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, + signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, + signing.HEADER_DIGEST, 'Content-Type'] + signature_max_validity = timedelta(minutes=5) + ) ) """ def __init__(self, host="{{{basePath}}}", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signature_max_validity=None, signed_headers=None): + signing_info=None): """Constructor """ self.host = host @@ -109,37 +86,8 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - """The signature max validity, expressed as a datetime.timedelta value. - It must be a positive value. - """ - if self.signature_max_validity is None and \ - signed_headers is not None and '(expires)' in signed_headers: - raise Exception( - "Signature max validity must be set when " \ - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included - in the HTTP signature calculation. + self.signing_info = signing_info + """The HTTP signing configuration """ {{#hasOAuthMethods}} self.access_token = "" @@ -478,3 +426,75 @@ class Configuration(object): url = url.replace("{" + variable_name + "}", used_value) return url + +class HttpSigningConfiguration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + """ + def __init__(self, key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signature_max_validity=None, signed_headers=None): + """Constructor + """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1v15, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + """ + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + """The signature max validity, expressed as a datetime.timedelta value. + It must be a positive value. + """ + if self.signature_max_validity is None and \ + signed_headers is not None and '(expires)' in signed_headers: + raise Exception( + "Signature max validity must be set when " \ + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if 'Authorization' in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + """A list of strings. Each value is the name of HTTP header that must be included + in the HTTP signature calculation. + """ diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 092c33234605..fa4e1b349d2d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -10,21 +10,29 @@ from Crypto.Hash import SHA256, SHA512 from base64 import b64encode from email.utils import formatdate +from {{packageName}}.configuration import Configuration + HEADER_REQUEST_TARGET = '(request-target)' HEADER_CREATED = '(created)' HEADER_EXPIRES = '(expires)' HEADER_HOST = 'host' HEADER_DATE = 'date' HEADER_DIGEST = 'Digest' +HEADER_AUTHORIZATION = 'Authorization' SCHEME_HS2019 = 'hs2019' +SCHEME_RSA_SHA256 = 'rsa-sha256' +SCHEME_RSA_SHA512 = 'rsa-sha512' ALGORITHM_RSASSA_PSS = 'PSS' ALGORITHM_RSASSA_PKCS1v15 = 'PKCS1v15' ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' -ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { + ECDSA_MODE_FIPS_186_3, + ECDSA_MODE_DETERMINISTIC_RFC6979 +} def get_http_signature_headers(configuration, resource_path, method, headers, body, query_params): """ @@ -45,7 +53,8 @@ def get_http_signature_headers(configuration, resource_path, method, headers, bo signed_headers_dict, request_headers_dict = get_signed_header_info(configuration, resource_path, method, headers, body, query_params) - header_items = ["{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] string_to_sign = "\n".join(header_items) digest, digest_prefix = get_message_digest(configuration, string_to_sign.encode()) @@ -61,9 +70,11 @@ def load_private_key(configuration): The private key is used to sign HTTP requests as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. """ - if configuration.private_key is not None: + if configuration.signing_info is None: + raise Exception("Configuration is missing signing info") + if configuration.signing_info.private_key is not None: return - with open(configuration.private_key_path, "rb") as f: + with open(configuration.signing_info.private_key_path, "rb") as f: # Decode PEM file and determine key type from PEM header. # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". keys = pem.parse(f.read()) @@ -71,9 +82,9 @@ def load_private_key(configuration): raise Exception("File must contain exactly one private key") key = keys[0].as_text() if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): - configuration.private_key = RSA.importKey(key) + configuration.signing_info.private_key = RSA.importKey(key) elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): - configuration.private_key = ECC.importKey(key) + configuration.signing_info.private_key = ECC.importKey(key) else: raise Exception("Unsupported key") @@ -109,12 +120,12 @@ def get_signed_header_info(configuration, resource_path, method, headers, body, stamp = mktime(now.timetuple()) cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) created = now.strftime("%s") - if configuration.signature_max_validity is not None: - expires = (now + configuration.signature_max_validity).strftime("%s") + if configuration.signing_info.signature_max_validity is not None: + expires = (now + configuration.signing_info.signature_max_validity).strftime("%s") signed_headers_dict = {} request_headers_dict = {} - for hdr_key in configuration.signed_headers_dict: + for hdr_key in configuration.signing_info.signed_headers_dict: hdr_key = hdr_key.lower() if hdr_key == HEADER_REQUEST_TARGET: value = request_target @@ -130,7 +141,8 @@ def get_signed_header_info(configuration, resource_path, method, headers, body, body_digest, digest_prefix = get_message_digest(configuration, request_body) b64_body_digest = b64encode(body_digest.digest()) value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict['Digest'] = '{0}{1}'.format(digest_prefix, b64_body_digest.decode('ascii')) + request_headers_dict['Digest'] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) elif hdr_key == HEADER_HOST: value = target_host request_headers_dict['Host'] = '{0}'.format(target_host) @@ -139,7 +151,7 @@ def get_signed_header_info(configuration, resource_path, method, headers, body, signed_headers_dict[hdr_key] = value # If the user has not provided any signed_headers, the default must be set to '(created)'. - if len(configuration.signed_headers_dict) == 0: + if len(configuration.signing_info.signed_headers_dict) == 0: signed_headers_dict[HEADER_CREATED] = created return signed_header_dict, request_headers_dict @@ -154,15 +166,16 @@ def get_message_digest(configuration, data): The prefix is a string that identifies the cryptographc hash. It is used to generate the 'Digest' header as specified in RFC 3230. """ - if configuration.signing_scheme in ["rsa-sha512", "hs2019"]: + if configuration.signing_info.signing_scheme in [SCHEME_RSA_SHA512, SCHEME_HS2019]: digest = SHA512.new() prefix = "SHA-512=" - elif configuration.signing_scheme in ["rsa-sha256"]: + elif configuration.signing_info.signing_scheme in [SCHEME_RSA_SHA256]: digest = SHA256.new() prefix = "SHA-256=" else: raise Exception( - "Unsupported signing algorithm: {0}".format(configuration.signing_scheme)) + "Unsupported signing algorithm: {0}".format( + configuration.signing_info.signing_scheme)) digest.update(data) return digest, prefix @@ -176,19 +189,21 @@ def sign_digest(configuration, digest): load_private_key(configuration) privkey = self.private_key if isinstance(privkey, RSA.RsaKey): - if configuration.signing_algorithm == ALGORITHM_RSASSA_PSS: + if configuration.signing_info.signing_algorithm == ALGORITHM_RSASSA_PSS: # RSASSA-PSS in Section 8.1 of RFC8017. signature = pss.new(privkey).sign(digest) - elif configuration.signing_algorithm == ALGORITHM_RSASSA_PKCS1v15: + elif configuration.signing_info.signing_algorithm == ALGORITHM_RSASSA_PKCS1v15: # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. signature = PKCS1_v1_5.new(privkey).sign(digest) else: - raise Exception("Unsupported signature algorithm: {0}".format(configuration.signing_algorithm)) + raise Exception("Unsupported signature algorithm: {0}".format( + configuration.signing_info.signing_algorithm)) elif isinstance(privkey, ECC.EccKey): - if configuration.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: - signature = DSS.new(privkey, configuration.signing_algorithm).sign(digest) + if configuration.signing_info.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(privkey, configuration.signing_info.signing_algorithm).sign(digest) else: - raise Exception("Unsupported signature algorithm: {0}".format(configuration.signing_algorithm)) + raise Exception("Unsupported signature algorithm: {0}".format( + configuration.signing_info.signing_algorithm)) else: raise Exception("Unsupported private key: {0}".format(type(privkey))) return b64encode(signature) @@ -211,7 +226,7 @@ def get_authorization_header(configuration, signed_headers, signed_msg): headers_value = " ".join(lower_keys) auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," - .format(configuration.key_id, configuration.signing_scheme) + .format(configuration.signing_info.key_id, configuration.signing_info.signing_scheme) if created_ts is not None: auth_str = auth_str + "created={0},".format(created_ts) if expires_ts is not None: From 00fd981031522973d6375e6f831c9cdc0262b305 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 21:47:58 -0800 Subject: [PATCH 056/102] address PR review comments --- .../resources/python/configuration.mustache | 76 +------- .../python-experimental/api_client.mustache | 3 +- .../python-experimental/signing.mustache | 165 +++++++++++++----- 3 files changed, 122 insertions(+), 122 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 219afea0dce9..dfeec94b872e 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -27,7 +27,7 @@ class Configuration(object): :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication :param signing_info: Configuration parameters for HTTP signature. - Must be an instance of {{{packageName}}}.HttpSigningConfiguration + Must be an instance of {{{packageName}}}.signing.HttpSigningConfiguration :Example: @@ -425,76 +425,4 @@ class Configuration(object): url = url.replace("{" + variable_name + "}", used_value) - return url - -class HttpSigningConfiguration(object): - """NOTE: This class is auto generated by OpenAPI Generator - - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, - when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. - """ - def __init__(self, key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signature_max_validity=None, signed_headers=None): - """Constructor - """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - """The signature max validity, expressed as a datetime.timedelta value. - It must be a positive value. - """ - if self.signature_max_validity is None and \ - signed_headers is not None and '(expires)' in signed_headers: - raise Exception( - "Signature max validity must be set when " \ - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - if 'Authorization' in signed_headers: - raise Exception("'Authorization' header cannot be included in signed headers") - self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included - in the HTTP signature calculation. - """ + return url \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index f20c4355174d..6a9fa0597f09 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -543,7 +543,8 @@ class ApiClient(object): if auth_setting['type'] == 'http-signature': # The HTTP signature scheme requires multiple HTTP headers # that are calculated dynamically. - auth_headers = signing.get_http_signature_headers(self.configuration, + auth_headers = signing.get_http_signature_headers( + self.configuration.signing_info, self.configuration.host, resource_path, method, headers, body, querys) for key, value in auth_headers.items(): headers[key] = value diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index fa4e1b349d2d..b5160a66f025 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -10,7 +10,7 @@ from Crypto.Hash import SHA256, SHA512 from base64 import b64encode from email.utils import formatdate -from {{packageName}}.configuration import Configuration +from {{packageName}}.configuration import HttpSigningConfiguration HEADER_REQUEST_TARGET = '(request-target)' HEADER_CREATED = '(created)' @@ -34,7 +34,79 @@ ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { ECDSA_MODE_DETERMINISTIC_RFC6979 } -def get_http_signature_headers(configuration, resource_path, method, headers, body, query_params): +class HttpSigningConfiguration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param key_id: The identifier of the cryptographic key, when signing HTTP requests. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key which is available to the client. + :param private_key_path: The path of the file containing a private key, + when signing HTTP requests. + :param signing_scheme: The signature scheme, when signing HTTP requests. + Supported value is hs2019. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + """ + def __init__(self, key_id=None, private_key_path=None, signing_scheme=None, + signing_algorithm=None, signature_max_validity=None, signed_headers=None): + """Constructor + """ + self.key_id = key_id + """The identifier of the key used to sign HTTP requests. + """ + self.private_key_path = private_key_path + """The path of the file containing a private key, used to sign HTTP requests. + """ + self.signing_scheme = signing_scheme + """The signature scheme when signing HTTP requests. + Supported values are hs2019, rsa-sha256, rsa-sha512. + """ + self.signing_algorithm = signing_algorithm + """The signature algorithm when signing HTTP requests. + For RSA keys, supported values are PKCS1v15, PSS. + For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. + """ + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + """The signature max validity, expressed as a datetime.timedelta value. + It must be a positive value. + """ + if self.signature_max_validity is None and \ + signed_headers is not None and '(expires)' in signed_headers: + raise Exception( + "Signature max validity must be set when " \ + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if 'Authorization' in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + """A list of strings. Each value is the name of HTTP header that must be included + in the HTTP signature calculation. + """ + +def get_http_signature_headers(signing_info, host, resource_path, method, headers, body, query_params): """ Create a cryptographic message signature for the HTTP request and add the signed headers. @@ -50,45 +122,45 @@ def get_http_signature_headers(configuration, resource_path, method, headers, bo if resource_path is None: raise Exception("Resource path must be set") - signed_headers_dict, request_headers_dict = get_signed_header_info(configuration, - resource_path, method, headers, body, query_params) + signed_headers_dict, request_headers_dict = get_signed_header_info(signing_info, + host, resource_path, method, headers, body, query_params) header_items = [ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] string_to_sign = "\n".join(header_items) - digest, digest_prefix = get_message_digest(configuration, string_to_sign.encode()) - b64_signed_msg = sign_digest(configuration, digest) + digest, digest_prefix = get_message_digest(signing_info, string_to_sign.encode()) + b64_signed_msg = sign_digest(signing_info, digest) - request_headers_dict['Authorization'] = get_authorization_header(configuration, + request_headers_dict['Authorization'] = get_authorization_header(signing_info, signed_headers_dict, b64_signed_msg) return request_headers_dict -def load_private_key(configuration): +def load_private_key(signing_info): """Load the private key used to sign HTTP requests. The private key is used to sign HTTP requests as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. """ - if configuration.signing_info is None: + if.signing_info is None: raise Exception("Configuration is missing signing info") - if configuration.signing_info.private_key is not None: + if signing_info.private_key is not None: return - with open(configuration.signing_info.private_key_path, "rb") as f: + with open(signing_info.private_key_path, 'rb') as f: # Decode PEM file and determine key type from PEM header. # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". keys = pem.parse(f.read()) if len(keys) != 1: raise Exception("File must contain exactly one private key") key = keys[0].as_text() - if key.startswith("-----BEGIN RSA PRIVATE KEY-----"): - configuration.signing_info.private_key = RSA.importKey(key) - elif key.startswith("-----BEGIN EC PRIVATE KEY-----"): - configuration.signing_info.private_key = ECC.importKey(key) + if key.startswith('-----BEGIN RSA PRIVATE KEY-----'): + signing_info.private_key = RSA.importKey(key) + elif key.startswith('-----BEGIN EC PRIVATE KEY-----'): + signing_info.private_key = ECC.importKey(key) else: raise Exception("Unsupported key") -def get_signed_header_info(configuration, resource_path, method, headers, body, query_params): +def get_signed_header_info(signing_info, host, resource_path, method, headers, body, query_params): """ Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. @@ -108,8 +180,8 @@ def get_signed_header_info(configuration, resource_path, method, headers, body, body = json.dumps(body) # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(configuration.host).netloc - target_path = urlparse(configuration.host).path + target_host = urlparse(host).netloc + target_path = urlparse(host).path request_target = method.lower() + " " + target_path + resource_path if query_params: raw_query = urlencode(query_params).replace('+', '%20') @@ -120,12 +192,12 @@ def get_signed_header_info(configuration, resource_path, method, headers, body, stamp = mktime(now.timetuple()) cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) created = now.strftime("%s") - if configuration.signing_info.signature_max_validity is not None: - expires = (now + configuration.signing_info.signature_max_validity).strftime("%s") + if signing_info.signature_max_validity is not None: + expires = (now + signing_info.signature_max_validity).strftime("%s") signed_headers_dict = {} request_headers_dict = {} - for hdr_key in configuration.signing_info.signed_headers_dict: + for hdr_key in signing_info.signed_headers_dict: hdr_key = hdr_key.lower() if hdr_key == HEADER_REQUEST_TARGET: value = request_target @@ -138,7 +210,7 @@ def get_signed_header_info(configuration, resource_path, method, headers, body, request_headers_dict['Date'] = '{0}'.format(cdate) elif hdr_key == HEADER_DIGEST: request_body = body.encode() - body_digest, digest_prefix = get_message_digest(configuration, request_body) + body_digest, digest_prefix = get_message_digest(signing_info, request_body) b64_body_digest = b64encode(body_digest.digest()) value = digest_prefix + b64_body_digest.decode('ascii') request_headers_dict['Digest'] = '{0}{1}'.format( @@ -151,12 +223,12 @@ def get_signed_header_info(configuration, resource_path, method, headers, body, signed_headers_dict[hdr_key] = value # If the user has not provided any signed_headers, the default must be set to '(created)'. - if len(configuration.signing_info.signed_headers_dict) == 0: + if len(signing_info.signed_headers_dict) == 0: signed_headers_dict[HEADER_CREATED] = created return signed_header_dict, request_headers_dict -def get_message_digest(configuration, data): +def get_message_digest(signing_info, data): """ Calculates and returns a cryptographic digest of a specified HTTP request. @@ -166,49 +238,49 @@ def get_message_digest(configuration, data): The prefix is a string that identifies the cryptographc hash. It is used to generate the 'Digest' header as specified in RFC 3230. """ - if configuration.signing_info.signing_scheme in [SCHEME_RSA_SHA512, SCHEME_HS2019]: + if signing_info.signing_scheme in [SCHEME_RSA_SHA512, SCHEME_HS2019]: digest = SHA512.new() - prefix = "SHA-512=" - elif configuration.signing_info.signing_scheme in [SCHEME_RSA_SHA256]: + prefix = 'SHA-512=' + elif signing_info.signing_scheme in [SCHEME_RSA_SHA256]: digest = SHA256.new() - prefix = "SHA-256=" + prefix = 'SHA-256=' else: raise Exception( "Unsupported signing algorithm: {0}".format( - configuration.signing_info.signing_scheme)) + signing_info.signing_scheme)) digest.update(data) return digest, prefix -def sign_digest(configuration, digest): +def sign_digest(signing_info, digest): """ - Signs a message digest with a private key specified in the configuration. + Signs a message digest with a private key specified in the signing_info. :param digest: A hashing object that contains the cryptographic digest of the HTTP request. :return: A base-64 string representing the cryptographic signature of the input digest. """ - load_private_key(configuration) - privkey = self.private_key - if isinstance(privkey, RSA.RsaKey): - if configuration.signing_info.signing_algorithm == ALGORITHM_RSASSA_PSS: + load_private_key(signing_info) + if isinstance(signing_info.private_key, RSA.RsaKey): + if signing_info.signing_algorithm == ALGORITHM_RSASSA_PSS: # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(privkey).sign(digest) - elif configuration.signing_info.signing_algorithm == ALGORITHM_RSASSA_PKCS1v15: + signature = pss.new(signing_info.private_key).sign(digest) + elif signing_info.signing_algorithm == ALGORITHM_RSASSA_PKCS1v15: # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(privkey).sign(digest) + signature = PKCS1_v1_5.new(signing_info.private_key).sign(digest) else: raise Exception("Unsupported signature algorithm: {0}".format( - configuration.signing_info.signing_algorithm)) - elif isinstance(privkey, ECC.EccKey): - if configuration.signing_info.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: - signature = DSS.new(privkey, configuration.signing_info.signing_algorithm).sign(digest) + signing_info.signing_algorithm)) + elif isinstance(signing_info.private_key, ECC.EccKey): + if signing_info.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(signing_info.private_key, + signing_info.signing_algorithm).sign(digest) else: raise Exception("Unsupported signature algorithm: {0}".format( - configuration.signing_info.signing_algorithm)) + signing_info.signing_algorithm)) else: - raise Exception("Unsupported private key: {0}".format(type(privkey))) + raise Exception("Unsupported private key: {0}".format(type(signing_info.private_key))) return b64encode(signature) -def get_authorization_header(configuration, signed_headers, signed_msg): +def get_authorization_header(signing_info, signed_headers, signed_msg): """ Calculates and returns the value of the 'Authorization' header when signing HTTP requests. @@ -219,14 +291,13 @@ def get_authorization_header(configuration, signed_headers, signed_msg): of the HTTP request. """ - headers_value = "" created_ts = signed_headers.get(HEADER_CREATED) expires_ts = signed_headers.get(HEADER_EXPIRES) lower_keys = [k.lower() for k in signed_headers] headers_value = " ".join(lower_keys) auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," - .format(configuration.signing_info.key_id, configuration.signing_info.signing_scheme) + .format(signing_info.key_id, signing_info.signing_scheme) if created_ts is not None: auth_str = auth_str + "created={0},".format(created_ts) if expires_ts is not None: From 09b9515f4d9654b10e3d767b5df53c2e8d3e4033 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 21:58:40 -0800 Subject: [PATCH 057/102] address PR review comments --- .../languages/PythonClientExperimentalCodegen.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index e1958d0485d9..6b44dcbc182d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -84,12 +84,6 @@ public PythonClientExperimentalCodegen() { apiTemplateFiles.remove("api.mustache"); apiTemplateFiles.put("python-experimental/api.mustache", ".py"); - Map securitySchemeMap = openAPI != null ? - (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; - List authMethods = fromSecurity(securitySchemeMap); - if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { - apiTemplateFiles.put("python-experimental/signing.mustache", ".py"); - } apiDocTemplateFiles.remove("api_doc.mustache"); apiDocTemplateFiles.put("python-experimental/api_doc.mustache", ".md"); @@ -124,6 +118,14 @@ public void processOpts() { supportingFiles.add(new SupportingFile("python-experimental/__init__package.mustache", packagePath(), "__init__.py")); + // Generate the 'signing.py' module, but only if the 'HTTP signature' security scheme is specified in the OAS. + Map securitySchemeMap = openAPI != null ? + (openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null) : null; + List authMethods = fromSecurity(securitySchemeMap); + if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { + supportingFiles.add(new SupportingFile("python-experimental/signing.mustache", packagePath(), "signing.py")); + } + Boolean generateSourceCodeOnly = false; if (additionalProperties.containsKey(CodegenConstants.SOURCECODEONLY_GENERATION)) { generateSourceCodeOnly = Boolean.valueOf(additionalProperties.get(CodegenConstants.SOURCECODEONLY_GENERATION).toString()); From 0e4f43c64c5fd0e2ac0280dd2e200c999199ed28 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 22:00:21 -0800 Subject: [PATCH 058/102] run samples scripts --- .../petstore_api/configuration.py | 86 +++++-------------- .../petstore_api/api_client.py | 3 - .../petstore_api/configuration.py | 86 +++++-------------- .../petstore_api/configuration.py | 86 +++++-------------- .../python/petstore_api/configuration.py | 86 +++++-------------- .../python/petstore_api/configuration.py | 83 +++++++----------- 6 files changed, 111 insertions(+), 319 deletions(-) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 366671df0fe1..cbcebf4bf579 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -31,32 +31,8 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, - when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -70,20 +46,23 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - key_id='my-key-id', - private_key_path='rsa.pem', - signing_scheme='hs2019', - signing_algorithm='PSS', - signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] - signature_max_validity=timedelta(minutes=5), + signing_info = petstore_api.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, + signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, + signing.HEADER_DIGEST, 'Content-Type'] + signature_max_validity = timedelta(minutes=5) + ) ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signature_max_validity=None, signed_headers=None): + signing_info=None): """Constructor """ self.host = host @@ -112,37 +91,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - """The signature max validity, expressed as a datetime.timedelta value. - It must be a positive value. - """ - if self.signature_max_validity is None and \ - signed_headers is not None and '(expires)' in signed_headers: - raise Exception( - "Signature max validity must be set when " \ - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included - in the HTTP signature calculation. + self.signing_info = signing_info + """The HTTP signing configuration """ self.access_token = "" """access token for OAuth/Bearer @@ -185,6 +135,10 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ self.connection_pool_maxsize = 100 """This value is passed to the aiohttp to limit simultaneous connections. @@ -409,4 +363,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url + return url \ No newline at end of file diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 7723fb3b87b9..3420d93586c5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -62,9 +62,6 @@ class ApiClient(object): PRIMITIVE_TYPES = ( (float, bool, six.binary_type, six.text_type) + six.integer_types ) - ECDSA_MODE_FIPS_186_3 = 'fips-186-3' - ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' - ECDSA_KEY_SIGNING_ALGORITHMS = {ECDSA_MODE_FIPS_186_3, ECDSA_MODE_DETERMINISTIC_RFC6979} _pool = None diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 2c6459e10eff..8fefc41430f9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -32,32 +32,8 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, - when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -71,20 +47,23 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - key_id='my-key-id', - private_key_path='rsa.pem', - signing_scheme='hs2019', - signing_algorithm='PSS', - signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] - signature_max_validity=timedelta(minutes=5), + signing_info = petstore_api.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, + signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, + signing.HEADER_DIGEST, 'Content-Type'] + signature_max_validity = timedelta(minutes=5) + ) ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signature_max_validity=None, signed_headers=None): + signing_info=None): """Constructor """ self.host = host @@ -113,37 +92,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - """The signature max validity, expressed as a datetime.timedelta value. - It must be a positive value. - """ - if self.signature_max_validity is None and \ - signed_headers is not None and '(expires)' in signed_headers: - raise Exception( - "Signature max validity must be set when " \ - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included - in the HTTP signature calculation. + self.signing_info = signing_info + """The HTTP signing configuration """ self.access_token = "" """access token for OAuth/Bearer @@ -186,6 +136,10 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -413,4 +367,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url + return url \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 2c6459e10eff..8fefc41430f9 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -32,32 +32,8 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, - when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -71,20 +47,23 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - key_id='my-key-id', - private_key_path='rsa.pem', - signing_scheme='hs2019', - signing_algorithm='PSS', - signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] - signature_max_validity=timedelta(minutes=5), + signing_info = petstore_api.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, + signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, + signing.HEADER_DIGEST, 'Content-Type'] + signature_max_validity = timedelta(minutes=5) + ) ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signature_max_validity=None, signed_headers=None): + signing_info=None): """Constructor """ self.host = host @@ -113,37 +92,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - """The signature max validity, expressed as a datetime.timedelta value. - It must be a positive value. - """ - if self.signature_max_validity is None and \ - signed_headers is not None and '(expires)' in signed_headers: - raise Exception( - "Signature max validity must be set when " \ - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included - in the HTTP signature calculation. + self.signing_info = signing_info + """The HTTP signing configuration """ self.access_token = "" """access token for OAuth/Bearer @@ -186,6 +136,10 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -413,4 +367,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url + return url \ No newline at end of file diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 2c6459e10eff..8fefc41430f9 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -32,32 +32,8 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, - when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -71,20 +47,23 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - key_id='my-key-id', - private_key_path='rsa.pem', - signing_scheme='hs2019', - signing_algorithm='PSS', - signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] - signature_max_validity=timedelta(minutes=5), + signing_info = petstore_api.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, + signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, + signing.HEADER_DIGEST, 'Content-Type'] + signature_max_validity = timedelta(minutes=5) + ) ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signature_max_validity=None, signed_headers=None): + signing_info=None): """Constructor """ self.host = host @@ -113,37 +92,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: - raise Exception("The signature max validity must be a positive value") - self.signature_max_validity = signature_max_validity - """The signature max validity, expressed as a datetime.timedelta value. - It must be a positive value. - """ - if self.signature_max_validity is None and \ - signed_headers is not None and '(expires)' in signed_headers: - raise Exception( - "Signature max validity must be set when " \ - "'(expires)' signature parameter is specified") - if len(signed_headers) != len(set(signed_headers)): - raise Exception("Cannot have duplicates in the signed_headers parameter") - self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included - in the HTTP signature calculation. + self.signing_info = signing_info + """The HTTP signing configuration """ self.access_token = "" """access token for OAuth/Bearer @@ -186,6 +136,10 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -413,4 +367,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url + return url \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index b63839851091..a5e63745b974 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -19,7 +19,7 @@ import six from six.moves import http_client as httplib - +from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -32,30 +32,8 @@ class Configuration(object): :param api_key_prefix: Dict to store API prefix (e.g. Bearer) :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, - when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signed_headers: A list of strings. Each value is the name of a HTTP header - that must be included in the HTTP signature calculation. - The two special signature headers '(request-target)' and '(created)' SHOULD be - included in SignedHeaders. - The '(created)' header expresses when the signature was created. - The '(request-target)' header is a concatenation of the lowercased :method, an - ASCII space, and the :path pseudo-headers. - When signed_headers is not specified, the client defaults to a single value, - '(created)', in the list of HTTP headers. - When SignedHeaders contains the 'Digest' value, the client performs the - following operations: - 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. - 2. Set the 'Digest' header in the request body. - 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -65,21 +43,27 @@ class Configuration(object): password='the-password', ) - Configure API client with HTTP signature authentication: + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - key_id='my-key-id', - private_key_path='rsa.pem', - signing_scheme='hs2019', - signing_algorithm='PSS', - signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest'] + signing_info = petstore_api.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, + signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, + signing.HEADER_DIGEST, 'Content-Type'] + signature_max_validity = timedelta(minutes=5) + ) ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, username="", password="", - key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signed_headers=None): + signing_info=None): """Constructor """ self.host = host @@ -108,24 +92,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ - self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ - self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ - self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ - self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ - self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included in the - HTTP signature calculation. + self.signing_info = signing_info + """The HTTP signing configuration """ self.access_token = "" """access token for OAuth/Bearer @@ -168,6 +136,10 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -337,6 +309,13 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_basic_auth_token() }, + 'http_signature_test': + { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + }, 'petstore_auth': { 'type': 'oauth2', @@ -436,4 +415,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url + return url \ No newline at end of file From c2da37a26e77cbbaa576d0794777db2e78ab6f1b Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 22:37:42 -0800 Subject: [PATCH 059/102] Address PR review comments --- .../python-experimental/api_client.mustache | 11 +- .../python-experimental/signing.mustache | 371 +++++++++--------- .../petstore_api/api_client.py | 2 +- 3 files changed, 192 insertions(+), 192 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 6a9fa0597f09..3dab70a0c039 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -523,7 +523,7 @@ class ApiClient(object): return content_types[0] def update_params_for_auth(self, headers, querys, auth_settings, - resource_path=None, method=None, body=None): + resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -543,9 +543,12 @@ class ApiClient(object): if auth_setting['type'] == 'http-signature': # The HTTP signature scheme requires multiple HTTP headers # that are calculated dynamically. - auth_headers = signing.get_http_signature_headers( - self.configuration.signing_info, self.configuration.host, - resource_path, method, headers, body, querys) + signing_info = self.configuration.signing_info + if signing_info is None: + raise Exception("HTTP signature configuration is missing") + auth_headers = signing_info.get_http_signature_headers( + self.configuration.host, resource_path, + method, headers, body, querys) for key, value in auth_headers.items(): headers[key] = value continue diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index b5160a66f025..5a2b7210b3f4 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -48,10 +48,6 @@ class HttpSigningConfiguration(object): when signing HTTP requests. :param signing_scheme: The signature scheme, when signing HTTP requests. Supported value is hs2019. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -66,9 +62,16 @@ class HttpSigningConfiguration(object): 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. 2. Set the 'Digest' header in the request body. 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_algorithm: The signature algorithm, when signing HTTP requests. + Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. + :param signature_max_validity: The signature max validity, + expressed as a datetime.timedelta value. """ - def __init__(self, key_id=None, private_key_path=None, signing_scheme=None, - signing_algorithm=None, signature_max_validity=None, signed_headers=None): + def __init__(self, key_id, private_key_path, + signing_scheme=SCHEME_HS2019, + signed_headers=[HEADER_CREATED], + signing_algorithm=None, + signature_max_validity=None): """Constructor """ self.key_id = key_id @@ -92,216 +95,210 @@ class HttpSigningConfiguration(object): """The signature max validity, expressed as a datetime.timedelta value. It must be a positive value. """ - if self.signature_max_validity is None and \ - signed_headers is not None and '(expires)' in signed_headers: + # If the user has not provided any signed_headers, the default must be set to '(created)'. + if signed_headers is None or len(signed_headers) == 0: + signed_headers = [HEADER_CREATED] + if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: raise Exception( "Signature max validity must be set when " \ "'(expires)' signature parameter is specified") if len(signed_headers) != len(set(signed_headers)): raise Exception("Cannot have duplicates in the signed_headers parameter") - if 'Authorization' in signed_headers: + if HEADER_AUTHORIZATION in signed_headers: raise Exception("'Authorization' header cannot be included in signed headers") self.signed_headers = signed_headers """A list of strings. Each value is the name of HTTP header that must be included in the HTTP signature calculation. """ -def get_http_signature_headers(signing_info, host, resource_path, method, headers, body, query_params): - """ - Create a cryptographic message signature for the HTTP request and add the signed headers. - - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A dict of HTTP headers that must be added to the outbound HTTP request. - """ - if method is None: - raise Exception("HTTP method must be set") - if resource_path is None: - raise Exception("Resource path must be set") - - signed_headers_dict, request_headers_dict = get_signed_header_info(signing_info, - host, resource_path, method, headers, body, query_params) - - header_items = [ - "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] - string_to_sign = "\n".join(header_items) - - digest, digest_prefix = get_message_digest(signing_info, string_to_sign.encode()) - b64_signed_msg = sign_digest(signing_info, digest) + def get_http_signature_headers(self, host, resource_path, method, headers, body, query_params): + """ + Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") - request_headers_dict['Authorization'] = get_authorization_header(signing_info, - signed_headers_dict, b64_signed_msg) + signed_headers_dict, request_headers_dict = self.get_signed_header_info( + host, resource_path, method, headers, body, query_params) - return request_headers_dict + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + string_to_sign = "\n".join(header_items) -def load_private_key(signing_info): - """Load the private key used to sign HTTP requests. - The private key is used to sign HTTP requests as defined in - https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. - """ - if.signing_info is None: - raise Exception("Configuration is missing signing info") - if signing_info.private_key is not None: - return - with open(signing_info.private_key_path, 'rb') as f: - # Decode PEM file and determine key type from PEM header. - # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". - keys = pem.parse(f.read()) - if len(keys) != 1: - raise Exception("File must contain exactly one private key") - key = keys[0].as_text() - if key.startswith('-----BEGIN RSA PRIVATE KEY-----'): - signing_info.private_key = RSA.importKey(key) - elif key.startswith('-----BEGIN EC PRIVATE KEY-----'): - signing_info.private_key = ECC.importKey(key) - else: - raise Exception("Unsupported key") + digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) + b64_signed_msg = self.sign_digest(digest) -def get_signed_header_info(signing_info, host, resource_path, method, headers, body, query_params): - """ - Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. + request_headers_dict[HEADER_AUTHORIZATION] = self.get_authorization_header( + signed_headers_dict, b64_signed_msg) - :param resource_path : A string representation of the HTTP request resource path. - :param method: A string representation of the HTTP request method, e.g. GET, POST. - :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. - :param query_params: A string representing the HTTP request query parameters. - :return: A tuple containing two dict objects: - The first dict contains the HTTP headers that are used to calculate the HTTP signature. - The second dict contains the HTTP headers that must be added to the outbound HTTP request. - """ + return request_headers_dict - if body is None: - body = '' - else: - body = json.dumps(body) + def load_private_key(self): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if self.private_key is not None: + return + with open(self.private_key_path, 'rb') as f: + # Decode PEM file and determine key type from PEM header. + # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". + keys = pem.parse(f.read()) + if len(keys) != 1: + raise Exception("File must contain exactly one private key") + key = keys[0].as_text() + if key.startswith('-----BEGIN RSA PRIVATE KEY-----'): + self.private_key = RSA.importKey(key) + elif key.startswith('-----BEGIN EC PRIVATE KEY-----'): + self.private_key = ECC.importKey(key) + else: + raise Exception("Unsupported key") - # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(host).netloc - target_path = urlparse(host).path - request_target = method.lower() + " " + target_path + resource_path - if query_params: - raw_query = urlencode(query_params).replace('+', '%20') - request_target += "?" + raw_query + def get_signed_header_info(self, host, resource_path, method, headers, body, query_params): + """ + Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. - # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. - now = datetime.datetime.now() - stamp = mktime(now.timetuple()) - cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) - created = now.strftime("%s") - if signing_info.signature_max_validity is not None: - expires = (now + signing_info.signature_max_validity).strftime("%s") + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The string representation of the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate the HTTP signature. + The second dict contains the HTTP headers that must be added to the outbound HTTP request. + """ - signed_headers_dict = {} - request_headers_dict = {} - for hdr_key in signing_info.signed_headers_dict: - hdr_key = hdr_key.lower() - if hdr_key == HEADER_REQUEST_TARGET: - value = request_target - elif hdr_key == HEADER_CREATED: - value = created - elif hdr_key == HEADER_EXPIRES: - value = expires - elif hdr_key == HEADER_DATE: - value = cdate - request_headers_dict['Date'] = '{0}'.format(cdate) - elif hdr_key == HEADER_DIGEST: - request_body = body.encode() - body_digest, digest_prefix = get_message_digest(signing_info, request_body) - b64_body_digest = b64encode(body_digest.digest()) - value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict['Digest'] = '{0}{1}'.format( - digest_prefix, b64_body_digest.decode('ascii')) - elif hdr_key == HEADER_HOST: - value = target_host - request_headers_dict['Host'] = '{0}'.format(target_host) + if body is None: + body = '' else: - value = headers[hdr_key] - signed_headers_dict[hdr_key] = value + body = json.dumps(body) - # If the user has not provided any signed_headers, the default must be set to '(created)'. - if len(signing_info.signed_headers_dict) == 0: - signed_headers_dict[HEADER_CREATED] = created + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(host).netloc + target_path = urlparse(host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query - return signed_header_dict, request_headers_dict + # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. + now = datetime.datetime.now() + stamp = mktime(now.timetuple()) + cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) + created = now.strftime("%s") + if self.signature_max_validity is not None: + expires = (now + self.signature_max_validity).strftime("%s") -def get_message_digest(signing_info, data): - """ - Calculates and returns a cryptographic digest of a specified HTTP request. + signed_headers_dict = {} + request_headers_dict = {} + for hdr_key in self.signed_headers: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = created + elif hdr_key == HEADER_EXPIRES: + value = expires + elif hdr_key == HEADER_DATE: + value = cdate + request_headers_dict['Date'] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST: + request_body = body.encode() + body_digest, digest_prefix = self.get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict['Digest'] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST: + value = target_host + request_headers_dict['Host'] = '{0}'.format(target_host) + else: + value = headers[hdr_key] + signed_headers_dict[hdr_key] = value - :param data: The string representation of the date to be hashed with a cryptographic hash. - :return: A tuple of (digest, prefix). - The digest is a hashing object that contains the cryptographic digest of the HTTP request. - The prefix is a string that identifies the cryptographc hash. It is used to generate the - 'Digest' header as specified in RFC 3230. - """ - if signing_info.signing_scheme in [SCHEME_RSA_SHA512, SCHEME_HS2019]: - digest = SHA512.new() - prefix = 'SHA-512=' - elif signing_info.signing_scheme in [SCHEME_RSA_SHA256]: - digest = SHA256.new() - prefix = 'SHA-256=' - else: - raise Exception( - "Unsupported signing algorithm: {0}".format( - signing_info.signing_scheme)) - digest.update(data) - return digest, prefix + return signed_header_dict, request_headers_dict -def sign_digest(signing_info, digest): - """ - Signs a message digest with a private key specified in the signing_info. + def get_message_digest(self, data): + """ + Calculates and returns a cryptographic digest of a specified HTTP request. - :param digest: A hashing object that contains the cryptographic digest of the HTTP request. - :return: A base-64 string representing the cryptographic signature of the input digest. - """ - load_private_key(signing_info) - if isinstance(signing_info.private_key, RSA.RsaKey): - if signing_info.signing_algorithm == ALGORITHM_RSASSA_PSS: - # RSASSA-PSS in Section 8.1 of RFC8017. - signature = pss.new(signing_info.private_key).sign(digest) - elif signing_info.signing_algorithm == ALGORITHM_RSASSA_PKCS1v15: - # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. - signature = PKCS1_v1_5.new(signing_info.private_key).sign(digest) + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used to generate the + 'Digest' header as specified in RFC 3230. + """ + if self.signing_scheme in [SCHEME_RSA_SHA512, SCHEME_HS2019]: + digest = SHA512.new() + prefix = 'SHA-512=' + elif self.signing_scheme in [SCHEME_RSA_SHA256]: + digest = SHA256.new() + prefix = 'SHA-256=' else: - raise Exception("Unsupported signature algorithm: {0}".format( - signing_info.signing_algorithm)) - elif isinstance(signing_info.private_key, ECC.EccKey): - if signing_info.signing_algorithm in ECDSA_KEY_SIGNING_ALGORITHMS: - signature = DSS.new(signing_info.private_key, - signing_info.signing_algorithm).sign(digest) + raise Exception("Unsupported signing algorithm: {0}".format(self.signing_scheme)) + digest.update(data) + return digest, prefix + + def sign_digest(self, digest): + """ + Signs a message digest with a private key specified in the signing_info. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + self.load_private_key() + sig_alg = self.signing_algorithm + if isinstance(self.private_key, RSA.RsaKey): + if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(self.private_key).sign(digest) + elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(self.private_key).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + elif isinstance(self.private_key, ECC.EccKey): + if sig_alg is None: + sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 + if sig_alg in ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(self.private_key, sig_alg).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) else: - raise Exception("Unsupported signature algorithm: {0}".format( - signing_info.signing_algorithm)) - else: - raise Exception("Unsupported private key: {0}".format(type(signing_info.private_key))) - return b64encode(signature) + raise Exception("Unsupported private key: {0}".format(type(self.private_key))) + return b64encode(signature) -def get_authorization_header(signing_info, signed_headers, signed_msg): - """ - Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param signed_headers : A list of strings. Each value is the name of a HTTP header that - must be included in the HTTP signature calculation. - :param signed_msg: A base-64 encoded string representation of the signature. - :return: The string value of the 'Authorization' header, representing the signature - of the HTTP request. - """ + def get_authorization_header(self, signed_headers, signed_msg): + """ + Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of strings. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ - created_ts = signed_headers.get(HEADER_CREATED) - expires_ts = signed_headers.get(HEADER_EXPIRES) - lower_keys = [k.lower() for k in signed_headers] - headers_value = " ".join(lower_keys) + created_ts = signed_headers.get(HEADER_CREATED) + expires_ts = signed_headers.get(HEADER_EXPIRES) + lower_keys = [k.lower() for k in signed_headers] + headers_value = " ".join(lower_keys) - auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," - .format(signing_info.key_id, signing_info.signing_scheme) - if created_ts is not None: - auth_str = auth_str + "created={0},".format(created_ts) - if expires_ts is not None: - auth_str = auth_str + "expires={0},".format(expires_ts) - auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" - .format(headers_value, signed_msg.decode('ascii')) - return auth_str + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," + .format(self.key_id, self.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" + .format(headers_value, signed_msg.decode('ascii')) + return auth_str diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 3420d93586c5..3c9b89b04896 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -513,7 +513,7 @@ def select_header_content_type(self, content_types): return content_types[0] def update_params_for_auth(self, headers, querys, auth_settings, - resource_path=None, method=None, body=None): + resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. From 581e4336132c90058fa77e2f7240109cd6527a47 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 22:40:33 -0800 Subject: [PATCH 060/102] Move 'private_key' field to signing module --- .../src/main/resources/python/configuration.mustache | 4 ---- .../resources/python/python-experimental/signing.mustache | 4 ++++ .../python-experimental/petstore_api/configuration.py | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index dfeec94b872e..6da67246a58e 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -139,10 +139,6 @@ class Configuration(object): self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ {{#asyncio}} self.connection_pool_maxsize = 100 diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 5a2b7210b3f4..d9d378ed141a 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -110,6 +110,10 @@ class HttpSigningConfiguration(object): """A list of strings. Each value is the name of HTTP header that must be included in the HTTP signature calculation. """ + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ def get_http_signature_headers(self, host, resource_path, method, headers, body, query_params): """ diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 8fefc41430f9..8ff1ae30fb16 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -136,10 +136,6 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved From 5f60e2e9dbf90f1e55242513b3d99bb2bd4f74f5 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 22:45:44 -0800 Subject: [PATCH 061/102] Move 'private_key' field to signing module --- .../resources/python/configuration.mustache | 17 ++++++++------- .../python-experimental/signing.mustache | 1 + .../petstore_api/configuration.py | 21 +++++++++---------- .../petstore_api/configuration.py | 17 ++++++++------- .../petstore_api/configuration.py | 21 +++++++++---------- .../python/petstore_api/configuration.py | 21 +++++++++---------- 6 files changed, 51 insertions(+), 47 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 6da67246a58e..fa5883964568 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -13,7 +13,6 @@ import urllib3 import six from six.moves import http_client as httplib -from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -41,15 +40,19 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = {{{packageName}}}.Configuration( - signing_info = {{{packageName}}}.HttpSigningConfiguration( + signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'rsa.pem', signing_scheme = signing.SCHEME_HS2019, signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, - signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, - signing.HEADER_DIGEST, 'Content-Type'] - signature_max_validity = timedelta(minutes=5) + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type'] + signature_max_validity = datetime.timedelta(minutes=5) ) ) """ @@ -421,4 +424,4 @@ class Configuration(object): url = url.replace("{" + variable_name + "}", used_value) - return url \ No newline at end of file + return url diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index d9d378ed141a..8710e74de5a9 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -2,6 +2,7 @@ {{>partial_header}} from __future__ import absolute_import +from datetime import timedelta from six.moves.urllib.parse import urlencode, urlparse import pem from Crypto.PublicKey import RSA, ECC diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index cbcebf4bf579..ce435b4566a4 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -18,7 +18,6 @@ import six from six.moves import http_client as httplib -from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -46,15 +45,19 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - signing_info = petstore_api.HttpSigningConfiguration( + signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'rsa.pem', signing_scheme = signing.SCHEME_HS2019, signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, - signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, - signing.HEADER_DIGEST, 'Content-Type'] - signature_max_validity = timedelta(minutes=5) + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type'] + signature_max_validity = datetime.timedelta(minutes=5) ) ) """ @@ -135,10 +138,6 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ self.connection_pool_maxsize = 100 """This value is passed to the aiohttp to limit simultaneous connections. @@ -363,4 +362,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url \ No newline at end of file + return url diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 8ff1ae30fb16..8f783fdb9cec 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -19,7 +19,6 @@ import six from six.moves import http_client as httplib -from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -47,15 +46,19 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - signing_info = petstore_api.HttpSigningConfiguration( + signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'rsa.pem', signing_scheme = signing.SCHEME_HS2019, signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, - signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, - signing.HEADER_DIGEST, 'Content-Type'] - signature_max_validity = timedelta(minutes=5) + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type'] + signature_max_validity = datetime.timedelta(minutes=5) ) ) """ @@ -363,4 +366,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url \ No newline at end of file + return url diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 8fefc41430f9..8f783fdb9cec 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -19,7 +19,6 @@ import six from six.moves import http_client as httplib -from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -47,15 +46,19 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - signing_info = petstore_api.HttpSigningConfiguration( + signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'rsa.pem', signing_scheme = signing.SCHEME_HS2019, signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, - signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, - signing.HEADER_DIGEST, 'Content-Type'] - signature_max_validity = timedelta(minutes=5) + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type'] + signature_max_validity = datetime.timedelta(minutes=5) ) ) """ @@ -136,10 +139,6 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -367,4 +366,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url \ No newline at end of file + return url diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 8fefc41430f9..8f783fdb9cec 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -19,7 +19,6 @@ import six from six.moves import http_client as httplib -from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -47,15 +46,19 @@ class Configuration(object): sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. conf = petstore_api.Configuration( - signing_info = petstore_api.HttpSigningConfiguration( + signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'rsa.pem', signing_scheme = signing.SCHEME_HS2019, signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, - signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, - signing.HEADER_DIGEST, 'Content-Type'] - signature_max_validity = timedelta(minutes=5) + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type'] + signature_max_validity = datetime.timedelta(minutes=5) ) ) """ @@ -136,10 +139,6 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -367,4 +366,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url \ No newline at end of file + return url From 69d394d9bdf7bd55fffe8b631ac6f6e0449f999c Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 22:48:48 -0800 Subject: [PATCH 062/102] code cleanup --- .../src/main/resources/python/configuration.mustache | 2 +- .../resources/python/python-experimental/api_client.mustache | 1 - .../petstore/python-asyncio/petstore_api/configuration.py | 2 +- .../petstore/python-experimental/petstore_api/api_client.py | 1 - .../petstore/python-experimental/petstore_api/configuration.py | 2 +- .../petstore/python-tornado/petstore_api/configuration.py | 2 +- samples/client/petstore/python/petstore_api/configuration.py | 2 +- 7 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index fa5883964568..3553189a2ea6 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -51,7 +51,7 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'] + 'Content-Type'], signature_max_validity = datetime.timedelta(minutes=5) ) ) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 3dab70a0c039..cd604285bafc 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -60,7 +60,6 @@ class ApiClient(object): PRIMITIVE_TYPES = ( (float, bool, six.binary_type, six.text_type) + six.integer_types ) - _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index ce435b4566a4..47eef7f2f42b 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -56,7 +56,7 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'] + 'Content-Type'], signature_max_validity = datetime.timedelta(minutes=5) ) ) diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 3c9b89b04896..76a349c7c4ba 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -62,7 +62,6 @@ class ApiClient(object): PRIMITIVE_TYPES = ( (float, bool, six.binary_type, six.text_type) + six.integer_types ) - _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 8f783fdb9cec..5a26e71302f8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -57,7 +57,7 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'] + 'Content-Type'], signature_max_validity = datetime.timedelta(minutes=5) ) ) diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 8f783fdb9cec..5a26e71302f8 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -57,7 +57,7 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'] + 'Content-Type'], signature_max_validity = datetime.timedelta(minutes=5) ) ) diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 8f783fdb9cec..5a26e71302f8 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -57,7 +57,7 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'] + 'Content-Type'], signature_max_validity = datetime.timedelta(minutes=5) ) ) From 3ee3c0e31a2b2bea40e8cae53dc8d774779d1a9f Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 23:01:51 -0800 Subject: [PATCH 063/102] remove use of strftime('%s'), which is non portable --- .../python/python-experimental/signing.mustache | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 8710e74de5a9..7c5ae35cb941 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -168,6 +168,12 @@ class HttpSigningConfiguration(object): else: raise Exception("Unsupported key") + def get_unix_time(self, ts): + """Converts and returns a datetime object to UNIX time, the number of seconds + elapsed since January 1, 1970 UTC. + """ + return (ts - datetime.datetime(1970,1,1)).total_seconds()) + def get_signed_header_info(self, host, resource_path, method, headers, body, query_params): """ Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. @@ -199,9 +205,9 @@ class HttpSigningConfiguration(object): now = datetime.datetime.now() stamp = mktime(now.timetuple()) cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) - created = now.strftime("%s") + created = self.get_unix_time(now) if self.signature_max_validity is not None: - expires = (now + self.signature_max_validity).strftime("%s") + expires = self.get_unix_time(now + self.signature_max_validity) signed_headers_dict = {} request_headers_dict = {} @@ -210,9 +216,9 @@ class HttpSigningConfiguration(object): if hdr_key == HEADER_REQUEST_TARGET: value = request_target elif hdr_key == HEADER_CREATED: - value = created + value = '{0}'.format(created) elif hdr_key == HEADER_EXPIRES: - value = expires + value = '{0}'.format(expires) elif hdr_key == HEADER_DATE: value = cdate request_headers_dict['Date'] = '{0}'.format(cdate) From 7787a7b5b0084b75be56ce1e84449b00b00c6002 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 23:12:50 -0800 Subject: [PATCH 064/102] code cleanup --- .../python/python-experimental/signing.mustache | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 7c5ae35cb941..b293286aa7bd 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -205,7 +205,9 @@ class HttpSigningConfiguration(object): now = datetime.datetime.now() stamp = mktime(now.timetuple()) cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) - created = self.get_unix_time(now) + # The '(created)' value MUST be a Unix timestamp integer value. + # Subsecond precision is not supported. + created = self.get_unix_time(int(now)) if self.signature_max_validity is not None: expires = self.get_unix_time(now + self.signature_max_validity) @@ -221,17 +223,17 @@ class HttpSigningConfiguration(object): value = '{0}'.format(expires) elif hdr_key == HEADER_DATE: value = cdate - request_headers_dict['Date'] = '{0}'.format(cdate) + request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) elif hdr_key == HEADER_DIGEST: request_body = body.encode() body_digest, digest_prefix = self.get_message_digest(request_body) b64_body_digest = b64encode(body_digest.digest()) value = digest_prefix + b64_body_digest.decode('ascii') - request_headers_dict['Digest'] = '{0}{1}'.format( + request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( digest_prefix, b64_body_digest.decode('ascii')) elif hdr_key == HEADER_HOST: value = target_host - request_headers_dict['Host'] = '{0}'.format(target_host) + request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) else: value = headers[hdr_key] signed_headers_dict[hdr_key] = value From 8b69dc7961692e5ec464607c3c8513a1513bec6a Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 23:24:18 -0800 Subject: [PATCH 065/102] code cleanup --- .../main/resources/python/configuration.mustache | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 3553189a2ea6..ba0c77ec86b0 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -39,6 +39,15 @@ class Configuration(object): Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the {{{packageName}}}.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + conf = {{{packageName}}}.Configuration( signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( key_id = 'my-key-id', @@ -51,7 +60,10 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'], + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], signature_max_validity = datetime.timedelta(minutes=5) ) ) From f67523cb0c4e85d662caeac4ec0df2be1b4a642c Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 23:36:40 -0800 Subject: [PATCH 066/102] code cleanup --- .../petstore_api/configuration.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 5a26e71302f8..5a81a533a999 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -45,6 +45,15 @@ class Configuration(object): Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + conf = petstore_api.Configuration( signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', @@ -57,7 +66,10 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'], + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], signature_max_validity = datetime.timedelta(minutes=5) ) ) From d169c6ef853d9fe72bb24092a25ca26ab74a1582 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 15 Jan 2020 23:37:51 -0800 Subject: [PATCH 067/102] run sample scripts --- .../petstore_api/configuration.py | 14 +++++++- .../petstore_api/configuration.py | 14 +++++++- .../python/petstore_api/configuration.py | 14 +++++++- .../python/petstore_api/configuration.py | 33 ++++++++++++------- 4 files changed, 61 insertions(+), 14 deletions(-) diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 47eef7f2f42b..2f90131d4869 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -44,6 +44,15 @@ class Configuration(object): Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + conf = petstore_api.Configuration( signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', @@ -56,7 +65,10 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'], + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], signature_max_validity = datetime.timedelta(minutes=5) ) ) diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 5a26e71302f8..5a81a533a999 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -45,6 +45,15 @@ class Configuration(object): Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + conf = petstore_api.Configuration( signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', @@ -57,7 +66,10 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'], + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], signature_max_validity = datetime.timedelta(minutes=5) ) ) diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 5a26e71302f8..5a81a533a999 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -45,6 +45,15 @@ class Configuration(object): Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + conf = petstore_api.Configuration( signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', @@ -57,7 +66,10 @@ class Configuration(object): signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, - 'Content-Type'], + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], signature_max_validity = datetime.timedelta(minutes=5) ) ) diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index a5e63745b974..a53abf5bbb3c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -19,7 +19,6 @@ import six from six.moves import http_client as httplib -from datetime import timedelta class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -46,16 +45,32 @@ class Configuration(object): Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + conf = petstore_api.Configuration( - signing_info = petstore_api.HttpSigningConfiguration( + signing_info = petstore_api.signing.HttpSigningConfiguration( key_id = 'my-key-id', private_key_path = 'rsa.pem', signing_scheme = signing.SCHEME_HS2019, signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, - signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, - signing.HEADER_DIGEST, 'Content-Type'] - signature_max_validity = timedelta(minutes=5) + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) ) ) """ @@ -136,10 +151,6 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.assert_hostname = None """Set this to True/False to enable/disable SSL hostname verification. """ - self.private_key = None - """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. - """ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved @@ -415,4 +426,4 @@ def get_host_from_settings(self, index, variables=None): url = url.replace("{" + variable_name + "}", used_value) - return url \ No newline at end of file + return url From 06d25b932f678576baee23807e0d469541a706fa Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 12:28:35 -0800 Subject: [PATCH 068/102] Address PR review comments. --- .../resources/python/configuration.mustache | 17 +-- .../python-experimental/api_client.mustache | 28 ++--- .../python-experimental/signing.mustache | 112 +++++++++--------- .../petstore_api/configuration.py | 3 + .../petstore_api/api_client.py | 3 +- .../petstore_api/configuration.py | 3 + .../petstore_api/configuration.py | 3 + .../python/petstore_api/configuration.py | 3 + .../python/petstore_api/configuration.py | 17 +-- 9 files changed, 102 insertions(+), 87 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index fc259b8c933f..3e0a15676575 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -14,6 +14,7 @@ import urllib3 import six from six.moves import http_client as httplib + class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -122,6 +123,8 @@ class Configuration(object): self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host self.signing_info = signing_info """The HTTP signing configuration """ @@ -362,13 +365,13 @@ class Configuration(object): } {{/isBasicBearer}} {{#isHttpSignature}} - '{{name}}': - { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - }, + if self.signing_info is not None: + auth['{{name}}'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } {{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index bee5b15221fb..57e55702504c 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -538,24 +538,22 @@ class ApiClient(object): for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: -{{#hasHttpSignatureMethods}} - if auth_setting['type'] == 'http-signature': - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - if signing_info is None: - raise Exception("HTTP signature configuration is missing") - auth_headers = signing_info.get_http_signature_headers( - self.configuration.host, resource_path, - method, headers, body, querys) - for key, value in auth_headers.items(): - headers[key] = value - continue -{{/hasHttpSignatureMethods}} if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] +{{#hasHttpSignatureMethods}} + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + # NOTE: no need to raise an exception because this entry only exists + # if signing_info is not None + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + headers.update(auth_headers) +{{/hasHttpSignatureMethods}} elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index b293286aa7bd..2ec3b55bc342 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -25,8 +25,8 @@ SCHEME_HS2019 = 'hs2019' SCHEME_RSA_SHA256 = 'rsa-sha256' SCHEME_RSA_SHA512 = 'rsa-sha512' -ALGORITHM_RSASSA_PSS = 'PSS' -ALGORITHM_RSASSA_PKCS1v15 = 'PKCS1v15' +ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' @@ -36,19 +36,28 @@ ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { } class HttpSigningConfiguration(object): - """NOTE: This class is auto generated by OpenAPI Generator + """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key + which is in possession of the API client. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The 'Authorization' header is added to outbound HTTP requests. + + NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. - :param key_id: The identifier of the cryptographic key, when signing HTTP requests. - An 'Authorization' header is calculated by creating a hash of select headers, - and optionally the body of the HTTP request, then signing the hash value using - a private key which is available to the client. - :param private_key_path: The path of the file containing a private key, + :param key_id: A string value specifying the identifier of the cryptographic key, when signing HTTP requests. - :param signing_scheme: The signature scheme, when signing HTTP requests. - Supported value is hs2019. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param signing_scheme: A string value specifying the signature scheme, when + signing HTTP requests. + Supported value are hs2019, rsa-sha256, rsa-sha512. + Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + available for server-side applications that only support the older + HTTP signature algorithms. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -63,40 +72,30 @@ class HttpSigningConfiguration(object): 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. 2. Set the 'Digest' header in the request body. 3. Include the 'Digest' header and value in the HTTP signature. - :param signing_algorithm: The signature algorithm, when signing HTTP requests. - Supported values are PKCS1v15, PSS; fips-186-3, deterministic-rfc6979. - :param signature_max_validity: The signature max validity, - expressed as a datetime.timedelta value. + :param signing_algorithm: A string value specifying the signature algorithm, when + signing HTTP requests. + Supported values are: + 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. + 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. + The default value is inferred from the private key. + The default value for RSA keys is RSASSA-PSS. + The default value for ECDSA keys is fips-186-3. + :param signature_max_validity: The signature max validity, expressed as + a datetime.timedelta value. It must be a positive value. """ - def __init__(self, key_id, private_key_path, - signing_scheme=SCHEME_HS2019, - signed_headers=[HEADER_CREATED], + def __init__(self, key_id, private_key_path, signing_scheme, /, + signed_headers=None, signing_algorithm=None, signature_max_validity=None): - """Constructor - """ self.key_id = key_id - """The identifier of the key used to sign HTTP requests. - """ self.private_key_path = private_key_path - """The path of the file containing a private key, used to sign HTTP requests. - """ self.signing_scheme = signing_scheme - """The signature scheme when signing HTTP requests. - Supported values are hs2019, rsa-sha256, rsa-sha512. - """ self.signing_algorithm = signing_algorithm - """The signature algorithm when signing HTTP requests. - For RSA keys, supported values are PKCS1v15, PSS. - For ECDSA keys, supported values are fips-186-3, deterministic-rfc6979. - """ if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: raise Exception("The signature max validity must be a positive value") self.signature_max_validity = signature_max_validity - """The signature max validity, expressed as a datetime.timedelta value. - It must be a positive value. - """ - # If the user has not provided any signed_headers, the default must be set to '(created)'. + # If the user has not provided any signed_headers, the default must be set to '(created)', + # as specified in the 'HTTP signature' standard. if signed_headers is None or len(signed_headers) == 0: signed_headers = [HEADER_CREATED] if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: @@ -108,15 +107,15 @@ class HttpSigningConfiguration(object): if HEADER_AUTHORIZATION in signed_headers: raise Exception("'Authorization' header cannot be included in signed headers") self.signed_headers = signed_headers - """A list of strings. Each value is the name of HTTP header that must be included - in the HTTP signature calculation. - """ self.private_key = None """The private key used to sign HTTP requests. Initialized when the PEM-encoded private key is loaded from a file. """ + self.host = None + """The host name, optionally followed by a colon and TCP port number. + self._load_private_key() - def get_http_signature_headers(self, host, resource_path, method, headers, body, query_params): + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): """ Create a cryptographic message signature for the HTTP request and add the signed headers. @@ -132,22 +131,22 @@ class HttpSigningConfiguration(object): if resource_path is None: raise Exception("Resource path must be set") - signed_headers_dict, request_headers_dict = self.get_signed_header_info( - host, resource_path, method, headers, body, query_params) + signed_headers_dict, request_headers_dict = self._get_signed_header_info( + resource_path, method, headers, body, query_params) header_items = [ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] string_to_sign = "\n".join(header_items) - digest, digest_prefix = self.get_message_digest(string_to_sign.encode()) - b64_signed_msg = self.sign_digest(digest) + digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) + b64_signed_msg = self._sign_digest(digest) - request_headers_dict[HEADER_AUTHORIZATION] = self.get_authorization_header( + request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( signed_headers_dict, b64_signed_msg) return request_headers_dict - def load_private_key(self): + def _load_private_key(self): """Load the private key used to sign HTTP requests. The private key is used to sign HTTP requests as defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. @@ -168,13 +167,13 @@ class HttpSigningConfiguration(object): else: raise Exception("Unsupported key") - def get_unix_time(self, ts): + def _get_unix_time(self, ts): """Converts and returns a datetime object to UNIX time, the number of seconds elapsed since January 1, 1970 UTC. """ return (ts - datetime.datetime(1970,1,1)).total_seconds()) - def get_signed_header_info(self, host, resource_path, method, headers, body, query_params): + def _get_signed_header_info(self, resource_path, method, headers, body, query_params): """ Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. @@ -194,8 +193,8 @@ class HttpSigningConfiguration(object): body = json.dumps(body) # Build the '(request-target)' HTTP signature parameter. - target_host = urlparse(host).netloc - target_path = urlparse(host).path + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path request_target = method.lower() + " " + target_path + resource_path if query_params: raw_query = urlencode(query_params).replace('+', '%20') @@ -207,9 +206,9 @@ class HttpSigningConfiguration(object): cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) # The '(created)' value MUST be a Unix timestamp integer value. # Subsecond precision is not supported. - created = self.get_unix_time(int(now)) + created = self._get_unix_time(int(now)) if self.signature_max_validity is not None: - expires = self.get_unix_time(now + self.signature_max_validity) + expires = self._get_unix_time(now + self.signature_max_validity) signed_headers_dict = {} request_headers_dict = {} @@ -226,7 +225,7 @@ class HttpSigningConfiguration(object): request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) elif hdr_key == HEADER_DIGEST: request_body = body.encode() - body_digest, digest_prefix = self.get_message_digest(request_body) + body_digest, digest_prefix = self._get_message_digest(request_body) b64_body_digest = b64encode(body_digest.digest()) value = digest_prefix + b64_body_digest.decode('ascii') request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( @@ -240,7 +239,7 @@ class HttpSigningConfiguration(object): return signed_header_dict, request_headers_dict - def get_message_digest(self, data): + def _get_message_digest(self, data): """ Calculates and returns a cryptographic digest of a specified HTTP request. @@ -250,10 +249,10 @@ class HttpSigningConfiguration(object): The prefix is a string that identifies the cryptographc hash. It is used to generate the 'Digest' header as specified in RFC 3230. """ - if self.signing_scheme in [SCHEME_RSA_SHA512, SCHEME_HS2019]: + if self.signing_scheme in {SCHEME_RSA_SHA512, SCHEME_HS2019}: digest = SHA512.new() prefix = 'SHA-512=' - elif self.signing_scheme in [SCHEME_RSA_SHA256]: + elif self.signing_scheme == SCHEME_RSA_SHA256: digest = SHA256.new() prefix = 'SHA-256=' else: @@ -261,14 +260,13 @@ class HttpSigningConfiguration(object): digest.update(data) return digest, prefix - def sign_digest(self, digest): + def _sign_digest(self, digest): """ Signs a message digest with a private key specified in the signing_info. :param digest: A hashing object that contains the cryptographic digest of the HTTP request. :return: A base-64 string representing the cryptographic signature of the input digest. """ - self.load_private_key() sig_alg = self.signing_algorithm if isinstance(self.private_key, RSA.RsaKey): if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: @@ -290,7 +288,7 @@ class HttpSigningConfiguration(object): raise Exception("Unsupported private key: {0}".format(type(self.private_key))) return b64encode(signature) - def get_authorization_header(self, signed_headers, signed_msg): + def _get_authorization_header(self, signed_headers, signed_msg): """ Calculates and returns the value of the 'Authorization' header when signing HTTP requests. diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index d803fd9c37fb..50cca10222c0 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -19,6 +19,7 @@ import six from six.moves import http_client as httplib + class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -127,6 +128,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host self.signing_info = signing_info """The HTTP signing configuration """ diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 3110333b0f66..eafa0b6e2cf6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -531,7 +531,8 @@ def update_params_for_auth(self, headers, querys, auth_settings, if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 37151a3517ae..cf2819c1d06c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -20,6 +20,7 @@ import six from six.moves import http_client as httplib + class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -128,6 +129,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host self.signing_info = signing_info """The HTTP signing configuration """ diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 37151a3517ae..cf2819c1d06c 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -20,6 +20,7 @@ import six from six.moves import http_client as httplib + class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -128,6 +129,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host self.signing_info = signing_info """The HTTP signing configuration """ diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 37151a3517ae..cf2819c1d06c 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -20,6 +20,7 @@ import six from six.moves import http_client as httplib + class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -128,6 +129,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host self.signing_info = signing_info """The HTTP signing configuration """ diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 06aee5a18829..99d8bac4b3d3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -20,6 +20,7 @@ import six from six.moves import http_client as httplib + class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator @@ -128,6 +129,8 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host self.signing_info = signing_info """The HTTP signing configuration """ @@ -347,13 +350,13 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_basic_auth_token() } - 'http_signature_test': - { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - }, + if self.signing_info is not None: + auth['http_signature_test'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } if self.access_token is not None: auth['petstore_auth'] = { 'type': 'oauth2', From 1bf286fb797700ab91735adae9c3989b16d819a7 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 16:17:31 -0800 Subject: [PATCH 069/102] Add http-signature security scheme --- .../petstore-with-fake-endpoints-models-for-testing.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index f6f35356afc3..d747440c1dc4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1168,6 +1168,12 @@ components: type: http scheme: bearer bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature schemas: Foo: type: object From 517019545f2258920644e558937b2ab8c28b0794 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 16:56:48 -0800 Subject: [PATCH 070/102] Run sample scripts for go --- .../go-experimental/go-petstore/README.md | 15 +++ .../go-petstore/api/openapi.yaml | 109 +++++++++--------- 2 files changed, 71 insertions(+), 53 deletions(-) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md index d030bad98357..77a389bf6ad5 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md @@ -218,6 +218,21 @@ r, err := client.Service.Operation(auth, args) ``` +### http_signature_test + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + + ### petstore_auth diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml index c5e930efc566..6fea12f3700a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -54,7 +54,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -68,11 +68,11 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found - 405: + "405": description: Validation exception security: - petstore_auth: @@ -105,7 +105,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -118,7 +118,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid status value security: - petstore_auth: @@ -145,7 +145,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -158,7 +158,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid tag value security: - petstore_auth: @@ -188,7 +188,7 @@ paths: type: integer style: simple responses: - 400: + "400": description: Invalid pet value security: - petstore_auth: @@ -211,7 +211,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -220,9 +220,9 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found security: - api_key: [] @@ -255,7 +255,7 @@ paths: type: string type: object responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -292,7 +292,7 @@ paths: type: string type: object responses: - 200: + "200": content: application/json: schema: @@ -310,7 +310,7 @@ paths: description: Returns a map of status codes to quantities operationId: getInventory responses: - 200: + "200": content: application/json: schema: @@ -335,7 +335,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -344,7 +344,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid Order summary: Place an order for a pet tags: @@ -364,9 +364,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Delete purchase order by ID tags: @@ -388,7 +388,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -397,9 +397,9 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Find purchase order by ID tags: @@ -464,7 +464,7 @@ paths: type: string style: form responses: - 200: + "200": content: application/xml: schema: @@ -488,7 +488,7 @@ paths: format: date-time type: string style: simple - 400: + "400": description: Invalid username/password supplied summary: Logs user into the system tags: @@ -516,9 +516,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found summary: Delete user tags: @@ -535,7 +535,7 @@ paths: type: string style: simple responses: - 200: + "200": content: application/xml: schema: @@ -544,9 +544,9 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found summary: Get user by user name tags: @@ -571,9 +571,9 @@ paths: description: Updated user object required: true responses: - 400: + "400": description: Invalid user supplied - 404: + "404": description: User not found summary: Updated user tags: @@ -585,7 +585,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Client' responses: - 200: + "200": content: application/json: schema: @@ -652,7 +652,7 @@ paths: type: integer style: form responses: - 400: + "400": description: Someting wrong security: - bearer_test: [] @@ -767,9 +767,9 @@ paths: type: string type: object responses: - 400: + "400": description: Invalid request - 404: + "404": description: Not found summary: To test enum parameters tags: @@ -780,7 +780,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Client' responses: - 200: + "200": content: application/json: schema: @@ -873,9 +873,9 @@ paths: - pattern_without_delimiter type: object responses: - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found security: - http_basic_test: [] @@ -897,7 +897,7 @@ paths: $ref: '#/components/schemas/OuterNumber' description: Input number as post body responses: - 200: + "200": content: '*/*': schema: @@ -916,7 +916,7 @@ paths: $ref: '#/components/schemas/OuterString' description: Input string as post body responses: - 200: + "200": content: '*/*': schema: @@ -935,7 +935,7 @@ paths: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body responses: - 200: + "200": content: '*/*': schema: @@ -954,7 +954,7 @@ paths: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body responses: - 200: + "200": content: '*/*': schema: @@ -982,7 +982,7 @@ paths: - param2 type: object responses: - 200: + "200": description: successful operation summary: test json serialization of form data tags: @@ -1000,7 +1000,7 @@ paths: description: request body required: true responses: - 200: + "200": description: successful operation summary: test inline additionalProperties tags: @@ -1023,7 +1023,7 @@ paths: $ref: '#/components/schemas/User' required: true responses: - 200: + "200": description: Success tags: - fake @@ -1034,7 +1034,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Client' responses: - 200: + "200": content: application/json: schema: @@ -1055,7 +1055,7 @@ paths: $ref: '#/components/schemas/FileSchemaTestClass' required: true responses: - 200: + "200": description: Success tags: - fake @@ -1110,7 +1110,7 @@ paths: type: array style: form responses: - 200: + "200": description: Success tags: - fake @@ -1144,7 +1144,7 @@ paths: - requiredFile type: object responses: - 200: + "200": content: application/json: schema: @@ -1160,7 +1160,7 @@ paths: /fake/health: get: responses: - 200: + "200": content: application/json: schema: @@ -1423,14 +1423,14 @@ components: type: integer property: type: string - 123Number: + "123Number": readOnly: true type: integer required: - name xml: name: Name - 200_response: + "200_response": description: Model for testing model name starting with number properties: name: @@ -1608,7 +1608,7 @@ components: type: object List: properties: - 123-list: + "123-list": type: string type: object Client: @@ -2057,3 +2057,6 @@ components: bearerFormat: JWT scheme: bearer type: http + http_signature_test: + scheme: signature + type: http From de10ae09c4bd5751a125a6194f281511375df07f Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 17:16:22 -0800 Subject: [PATCH 071/102] Fix issue uncovered in integration branch --- .../resources/python/python-experimental/signing.mustache | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 2ec3b55bc342..92999cbdf48d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -11,8 +11,6 @@ from Crypto.Hash import SHA256, SHA512 from base64 import b64encode from email.utils import formatdate -from {{packageName}}.configuration import HttpSigningConfiguration - HEADER_REQUEST_TARGET = '(request-target)' HEADER_CREATED = '(created)' HEADER_EXPIRES = '(expires)' @@ -83,7 +81,7 @@ class HttpSigningConfiguration(object): :param signature_max_validity: The signature max validity, expressed as a datetime.timedelta value. It must be a positive value. """ - def __init__(self, key_id, private_key_path, signing_scheme, /, + def __init__(self, key_id, private_key_path, signing_scheme, signed_headers=None, signing_algorithm=None, signature_max_validity=None): From 01766941fe8033cfbcdefa1c434c0d4f456cedd7 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 17:20:55 -0800 Subject: [PATCH 072/102] Fix issue uncovered in integration branch --- .../resources/python/python-experimental/signing.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 92999cbdf48d..1eb60d0ec0c3 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -107,15 +107,15 @@ class HttpSigningConfiguration(object): self.signed_headers = signed_headers self.private_key = None """The private key used to sign HTTP requests. - Initialized when the PEM-encoded private key is loaded from a file. + Initialized when the PEM-encoded private key is loaded from a file. """ self.host = None """The host name, optionally followed by a colon and TCP port number. + """ self._load_private_key() def get_http_signature_headers(self, resource_path, method, headers, body, query_params): - """ - Create a cryptographic message signature for the HTTP request and add the signed headers. + """Create a cryptographic message signature for the HTTP request and add the signed headers. :param resource_path : A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method, e.g. GET, POST. @@ -169,7 +169,7 @@ class HttpSigningConfiguration(object): """Converts and returns a datetime object to UNIX time, the number of seconds elapsed since January 1, 1970 UTC. """ - return (ts - datetime.datetime(1970,1,1)).total_seconds()) + return (ts - datetime.datetime(1970,1,1)).total_seconds() def _get_signed_header_info(self, resource_path, method, headers, body, query_params): """ From 155f55497cf3a17b0838a2df85dc64d5011a3d77 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 17:23:20 -0800 Subject: [PATCH 073/102] Fix issue uncovered in integration branch --- .../resources/python/python-experimental/signing.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 1eb60d0ec0c3..97897600296f 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -302,12 +302,12 @@ class HttpSigningConfiguration(object): lower_keys = [k.lower() for k in signed_headers] headers_value = " ".join(lower_keys) - auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\"," - .format(self.key_id, self.signing_scheme) + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( + self.key_id, self.signing_scheme) if created_ts is not None: auth_str = auth_str + "created={0},".format(created_ts) if expires_ts is not None: auth_str = auth_str + "expires={0},".format(expires_ts) - auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"" - .format(headers_value, signed_msg.decode('ascii')) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( + headers_value, signed_msg.decode('ascii')) return auth_str From 0426487ff224c8eabd2a94172bc980de462a3ff4 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 17:26:51 -0800 Subject: [PATCH 074/102] Fix issue uncovered in integration branch --- .../resources/python/python-experimental/signing.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 97897600296f..89ab7ad3ea93 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -29,8 +29,8 @@ ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { - ECDSA_MODE_FIPS_186_3, - ECDSA_MODE_DETERMINISTIC_RFC6979 + ALGORITHM_ECDSA_MODE_FIPS_186_3, + ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 } class HttpSigningConfiguration(object): From 6cfefa0a8d8a5a6d8c68ea50bd435e326220b8e0 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 17:31:44 -0800 Subject: [PATCH 075/102] Run samples scripts --- .../petstore_api/models/animal.py | 6 ++++-- .../petstore_api/models/array_test.py | 3 ++- .../python-experimental/petstore_api/models/cat.py | 6 ++++-- .../python-experimental/petstore_api/models/child.py | 6 ++++-- .../petstore_api/models/child_cat.py | 6 ++++-- .../petstore_api/models/child_dog.py | 6 ++++-- .../petstore_api/models/child_lizard.py | 6 ++++-- .../python-experimental/petstore_api/models/dog.py | 6 ++++-- .../petstore_api/models/enum_test.py | 3 ++- .../petstore_api/models/file_schema_test_class.py | 3 ++- .../petstore_api/models/map_test.py | 3 ++- ...xed_properties_and_additional_properties_class.py | 3 ++- .../petstore_api/models/outer_composite.py | 3 ++- .../petstore_api/models/parent.py | 6 ++++-- .../petstore_api/models/parent_pet.py | 12 ++++++++---- .../python-experimental/petstore_api/models/pet.py | 6 ++++-- 16 files changed, 56 insertions(+), 28 deletions(-) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index 2da7a5923a5b..abb0d49e74c9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -31,11 +31,13 @@ try: from petstore_api.models import cat except ImportError: - cat = sys.modules['petstore_api.models.cat'] + cat = sys.modules[ + 'petstore_api.models.cat'] try: from petstore_api.models import dog except ImportError: - dog = sys.modules['petstore_api.models.dog'] + dog = sys.modules[ + 'petstore_api.models.dog'] class Animal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index 3c15d79a3d01..c99bc985cab1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import read_only_first except ImportError: - read_only_first = sys.modules['petstore_api.models.read_only_first'] + read_only_first = sys.modules[ + 'petstore_api.models.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 6b4985dc4a9b..229d04455540 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -31,11 +31,13 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import cat_all_of except ImportError: - cat_all_of = sys.modules['petstore_api.models.cat_all_of'] + cat_all_of = sys.modules[ + 'petstore_api.models.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/models/child.py index 8a61f35ba14b..9721a0b684f4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_all_of except ImportError: - child_all_of = sys.modules['petstore_api.models.child_all_of'] + child_all_of = sys.modules[ + 'petstore_api.models.child_all_of'] try: from petstore_api.models import parent except ImportError: - parent = sys.modules['petstore_api.models.parent'] + parent = sys.modules[ + 'petstore_api.models.parent'] class Child(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index b329281e9c25..7828dba8cb87 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_cat_all_of except ImportError: - child_cat_all_of = sys.modules['petstore_api.models.child_cat_all_of'] + child_cat_all_of = sys.modules[ + 'petstore_api.models.child_cat_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index eaea5cba93c8..36180f157134 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_dog_all_of except ImportError: - child_dog_all_of = sys.modules['petstore_api.models.child_dog_all_of'] + child_dog_all_of = sys.modules[ + 'petstore_api.models.child_dog_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildDog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index a038974bb543..cb79d4ad6048 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_lizard_all_of except ImportError: - child_lizard_all_of = sys.modules['petstore_api.models.child_lizard_all_of'] + child_lizard_all_of = sys.modules[ + 'petstore_api.models.child_lizard_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildLizard(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index 54ccf0e390ab..b29e31d4e5d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -31,11 +31,13 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import dog_all_of except ImportError: - dog_all_of = sys.modules['petstore_api.models.dog_all_of'] + dog_all_of = sys.modules[ + 'petstore_api.models.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 5df1bcbc2e7d..42a4c562150c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import outer_enum except ImportError: - outer_enum = sys.modules['petstore_api.models.outer_enum'] + outer_enum = sys.modules[ + 'petstore_api.models.outer_enum'] class EnumTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 62a9a4194a18..f1abb16cbc33 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -31,7 +31,8 @@ try: from petstore_api.models import file except ImportError: - file = sys.modules['petstore_api.models.file'] + file = sys.modules[ + 'petstore_api.models.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index e6680cc73493..e996e27991c1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import string_boolean_map except ImportError: - string_boolean_map = sys.modules['petstore_api.models.string_boolean_map'] + string_boolean_map = sys.modules[ + 'petstore_api.models.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 52969b942bfa..60b897624568 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -31,7 +31,8 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index 013e386adff8..067ac6a14007 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -31,7 +31,8 @@ try: from petstore_api.models import outer_number except ImportError: - outer_number = sys.modules['petstore_api.models.outer_number'] + outer_number = sys.modules[ + 'petstore_api.models.outer_number'] class OuterComposite(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/models/parent.py index 4175d7792f63..70534d8026eb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent.py @@ -31,11 +31,13 @@ try: from petstore_api.models import grandparent except ImportError: - grandparent = sys.modules['petstore_api.models.grandparent'] + grandparent = sys.modules[ + 'petstore_api.models.grandparent'] try: from petstore_api.models import parent_all_of except ImportError: - parent_all_of = sys.modules['petstore_api.models.parent_all_of'] + parent_all_of = sys.modules[ + 'petstore_api.models.parent_all_of'] class Parent(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index d98bdc6f6570..16d00f42da53 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -31,19 +31,23 @@ try: from petstore_api.models import child_cat except ImportError: - child_cat = sys.modules['petstore_api.models.child_cat'] + child_cat = sys.modules[ + 'petstore_api.models.child_cat'] try: from petstore_api.models import child_dog except ImportError: - child_dog = sys.modules['petstore_api.models.child_dog'] + child_dog = sys.modules[ + 'petstore_api.models.child_dog'] try: from petstore_api.models import child_lizard except ImportError: - child_lizard = sys.modules['petstore_api.models.child_lizard'] + child_lizard = sys.modules[ + 'petstore_api.models.child_lizard'] try: from petstore_api.models import grandparent_animal except ImportError: - grandparent_animal = sys.modules['petstore_api.models.grandparent_animal'] + grandparent_animal = sys.modules[ + 'petstore_api.models.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 83b4679eb7a3..11ffa6ff44f5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -31,11 +31,13 @@ try: from petstore_api.models import category except ImportError: - category = sys.modules['petstore_api.models.category'] + category = sys.modules[ + 'petstore_api.models.category'] try: from petstore_api.models import tag except ImportError: - tag = sys.modules['petstore_api.models.tag'] + tag = sys.modules[ + 'petstore_api.models.tag'] class Pet(ModelNormal): From c8866584ae40fe339427aa0cef514c66fdda8722 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 17:55:43 -0800 Subject: [PATCH 076/102] move http signature tests to separate file --- .../python-experimental/tests/test_pet_api.py | 30 ---- .../tests/test_http_signature.py | 145 ++++++++++++++++++ 2 files changed, 145 insertions(+), 30 deletions(-) create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 1bdb3981e38a..1897c67f4d66 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -175,36 +175,6 @@ def test_separate_default_config_instances(self): pet_api2.api_client.configuration.host = 'someotherhost' self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) - def test_http_signature(self): - config = Configuration( - key_id="my-key-id", - private_key_path="rsa.pem", - signing_scheme="hs2019", - signing_algorithm='PKCS1v15', - signed_headers=['(request-target)', '(created)', 'host', 'date', 'Content-Type', 'Digest']) - config.host = HOST - self.api_client = petstore_api.ApiClient(config) - self.pet_api = petstore_api.PetApi(self.api_client) - - mock_pool = MockPoolManager(self) - self.api_client.rest_client.pool_manager = mock_pool - - mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(total=5)) - mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) - - self.pet_api.add_pet(self.pet, _request_timeout=5) - self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) - def test_async_request(self): thread = self.pet_api.add_pet(self.pet, async_req=True) response = thread.get() diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py new file mode 100644 index 000000000000..5ab218ff4177 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ docker pull swaggerapi/petstore +$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +from collections import namedtuple +import json +import os +import unittest + +import petstore_api +from petstore_api import Configuration +from petstore_api.rest import ( + RESTClientObject, + RESTResponse +) + +import six + +from petstore_api.exceptions import ( + ApiException, + ApiValueError, + ApiTypeError, +) + +from .util import id_gen + +import urllib3 + +if six.PY3: + from unittest.mock import patch +else: + from mock import patch + +HOST = 'http://localhost/v2' + + +class TimeoutWithEqual(urllib3.Timeout): + def __init__(self, *arg, **kwargs): + super(TimeoutWithEqual, self).__init__(*arg, **kwargs) + + def __eq__(self, other): + return self._read == other._read and self._connect == other._connect and self.total == other.total + + +class MockPoolManager(object): + def __init__(self, tc): + self._tc = tc + self._reqs = [] + + def expect_request(self, *args, **kwargs): + self._reqs.append((args, kwargs)) + + def request(self, *args, **kwargs): + self._tc.assertTrue(len(self._reqs) > 0) + r = self._reqs.pop(0) + self._tc.maxDiff = None + self._tc.assertEqual(r[0], args) + self._tc.assertEqual(r[1], kwargs) + return urllib3.HTTPResponse(status=200, body=b'test') + + +class PetApiTests(unittest.TestCase): + + def setUp(self): + config = Configuration() + config.host = HOST + config.access_token = 'ACCESS_TOKEN' + self.api_client = petstore_api.ApiClient(config) + self.pet_api = petstore_api.PetApi(self.api_client) + self.setUpModels() + self.setUpFiles() + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "python-pet-tag" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def setUpFiles(self): + self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") + self.test_file_dir = os.path.realpath(self.test_file_dir) + + def test_http_signature(self): + config = HttpSigningConfiguration( + key_id="my-key-id", + private_key_path="rsa.pem", + signing_scheme=signing.SCHEME_HS2019, + signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type' + ] + ) + config.host = HOST + self.api_client = petstore_api.ApiClient(config) + self.pet_api = petstore_api.PetApi(self.api_client) + + mock_pool = MockPoolManager(self) + self.api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(total=5)) + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) + + self.pet_api.add_pet(self.pet, _request_timeout=5) + self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) + + def test_async_request(self): + thread = self.pet_api.add_pet(self.pet, async_req=True) + response = thread.get() + self.assertIsNone(response) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + result = thread.get() + self.assertIsInstance(result, petstore_api.Pet) + From c7a01ec4c3771ea2642f1ee59b08aa499bf211f5 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 18:00:59 -0800 Subject: [PATCH 077/102] move http signature tests to separate file --- .../python-experimental/tests/test_http_signature.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 5ab218ff4177..779d86bd620c 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -134,12 +134,4 @@ def test_http_signature(self): self.pet_api.add_pet(self.pet, _request_timeout=5) self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) - def test_async_request(self): - thread = self.pet_api.add_pet(self.pet, async_req=True) - response = thread.get() - self.assertIsNone(response) - - thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) - result = thread.get() - self.assertIsInstance(result, petstore_api.Pet) From 3ceda7840f23075be72f351256fd7b84dc984728 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 18:52:18 -0800 Subject: [PATCH 078/102] unit tests for HTTP signature --- .../python-experimental/tests/__init__.py | 0 .../tests/test_http_signature.py | 56 +++++++++++++------ .../python-experimental/tests/util.py | 8 +++ 3 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/tests/util.py diff --git a/samples/openapi3/client/petstore/python-experimental/tests/__init__.py b/samples/openapi3/client/petstore/python-experimental/tests/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 779d86bd620c..eba5fa0b9e10 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -15,9 +15,10 @@ import json import os import unittest +import shutil import petstore_api -from petstore_api import Configuration +from petstore_api import Configuration, signing from petstore_api.rest import ( RESTClientObject, RESTResponse @@ -42,6 +43,23 @@ HOST = 'http://localhost/v2' +# Test RSA private key as published in Appendix C 'Test Values' of +# https://www.ietf.org/id/draft-cavage-http-signatures-12.txt +RSA_TEST_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF +NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F +UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB +AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA +QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK +kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg +f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u +412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc +mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 +kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA +gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW +G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI +7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== +-----END RSA PRIVATE KEY-----""" class TimeoutWithEqual(urllib3.Timeout): def __init__(self, *arg, **kwargs): @@ -71,14 +89,13 @@ def request(self, *args, **kwargs): class PetApiTests(unittest.TestCase): def setUp(self): - config = Configuration() - config.host = HOST - config.access_token = 'ACCESS_TOKEN' - self.api_client = petstore_api.ApiClient(config) - self.pet_api = petstore_api.PetApi(self.api_client) self.setUpModels() self.setUpFiles() + def tearDown(self): + if os.path.exists(self.rsa_key_path): + os.unlink(self.rsa_key_path) + def setUpModels(self): self.category = petstore_api.Category() self.category.id = id_gen() @@ -95,11 +112,17 @@ def setUpModels(self): def setUpFiles(self): self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") self.test_file_dir = os.path.realpath(self.test_file_dir) + if not os.path.exists(self.test_file_dir): + os.mkdir(self.test_file_dir) + self.rsa_key_path = os.path.join(self.test_file_dir, 'rsa.pem') def test_http_signature(self): - config = HttpSigningConfiguration( + with open(self.rsa_key_path, 'w') as f: + f.write(RSA_TEST_PRIVATE_KEY) + + signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path="rsa.pem", + private_key_path=self.rsa_key_path, signing_scheme=signing.SCHEME_HS2019, signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, signed_headers=[ @@ -111,27 +134,28 @@ def test_http_signature(self): 'Content-Type' ] ) - config.host = HOST - self.api_client = petstore_api.ApiClient(config) - self.pet_api = petstore_api.PetApi(self.api_client) + config = Configuration(host=HOST, signing_info=signing_cfg) + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) mock_pool = MockPoolManager(self) - self.api_client.rest_client.pool_manager = mock_pool + api_client.rest_client.pool_manager = mock_pool mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', 'Authorization': 'Bearer ', 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=TimeoutWithEqual(total=5)) mock_pool.expect_request('POST', 'http://localhost/v2/pet', - body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', 'Authorization': 'Bearer ', 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) - self.pet_api.add_pet(self.pet, _request_timeout=5) - self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) + pet_api.add_pet(pet, _request_timeout=5) + pet_api.add_pet(pet, _request_timeout=(1, 2)) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/util.py b/samples/openapi3/client/petstore/python-experimental/tests/util.py new file mode 100644 index 000000000000..113d7dcc5478 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tests/util.py @@ -0,0 +1,8 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) From 707d40bfa7d6599b2a2f7a9abe38696e8182653a Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 20:48:21 -0800 Subject: [PATCH 079/102] continue implementation of unit tests --- .../python-experimental/tests/test_http_signature.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index eba5fa0b9e10..e6e32ad9e4d9 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -135,6 +135,9 @@ def test_http_signature(self): ] ) config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None api_client = petstore_api.ApiClient(config) pet_api = petstore_api.PetApi(api_client) @@ -155,7 +158,7 @@ def test_http_signature(self): 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) - pet_api.add_pet(pet, _request_timeout=5) - pet_api.add_pet(pet, _request_timeout=(1, 2)) + pet_api.add_pet(self.pet, _request_timeout=5) + pet_api.add_pet(self.pet, _request_timeout=(1, 2)) From ef59c0ca45c721b5163126895a01032faa930bda Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 16 Jan 2020 20:49:27 -0800 Subject: [PATCH 080/102] add http_signature_test to security scheme --- .../3_0/petstore-with-fake-endpoints-models-for-testing.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index d747440c1dc4..cf45bf76e379 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -43,6 +43,7 @@ paths: '405': description: Invalid input security: + - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -62,6 +63,7 @@ paths: '405': description: Validation exception security: + - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -107,6 +109,7 @@ paths: '400': description: Invalid status value security: + - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -147,6 +150,7 @@ paths: '400': description: Invalid tag value security: + - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' From 9dacccaa763a35c9c856e4173e952b6b654a915e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 00:04:24 -0800 Subject: [PATCH 081/102] add unit tests for http signature --- .../python-experimental/api_client.mustache | 11 +- .../python-experimental/signing.mustache | 46 ++-- .../tests/test_http_signature.py | 240 ++++++++++++++++-- 3 files changed, 257 insertions(+), 40 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 57e55702504c..c2eb32d3abe9 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -153,14 +153,14 @@ class ApiClient(object): collection_formats) post_params.extend(self.files_parameters(files)) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) - # body if body: body = self.sanitize_for_serialization(body) + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) + # request url if _host is None: url = self.configuration.host + resource_path @@ -530,7 +530,8 @@ class ApiClient(object): :param auth_settings: Authentication setting identifiers list. :resource_path: A string representation of the HTTP request resource path. :method: A string representation of the HTTP request method. - :body: A string representation of the body of the HTTP request. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). """ if not auth_settings: return diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 89ab7ad3ea93..12e75c0efcf9 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -2,20 +2,23 @@ {{>partial_header}} from __future__ import absolute_import -from datetime import timedelta -from six.moves.urllib.parse import urlencode, urlparse -import pem +from base64 import b64encode from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS from Crypto.Hash import SHA256, SHA512 -from base64 import b64encode +from datetime import datetime, timedelta from email.utils import formatdate +import json +import os +import pem +from six.moves.urllib.parse import urlencode, urlparse +from time import mktime HEADER_REQUEST_TARGET = '(request-target)' HEADER_CREATED = '(created)' HEADER_EXPIRES = '(expires)' -HEADER_HOST = 'host' -HEADER_DATE = 'date' +HEADER_HOST = 'Host' +HEADER_DATE = 'Date' HEADER_DIGEST = 'Digest' HEADER_AUTHORIZATION = 'Authorization' @@ -86,7 +89,11 @@ class HttpSigningConfiguration(object): signing_algorithm=None, signature_max_validity=None): self.key_id = key_id + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") self.private_key_path = private_key_path + if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: + raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) self.signing_scheme = signing_scheme self.signing_algorithm = signing_algorithm if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: @@ -120,7 +127,7 @@ class HttpSigningConfiguration(object): :param resource_path : A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method, e.g. GET, POST. :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. + :param body: The object representing the HTTP request body. :param query_params: A string representing the HTTP request query parameters. :return: A dict of HTTP headers that must be added to the outbound HTTP request. """ @@ -161,7 +168,7 @@ class HttpSigningConfiguration(object): if key.startswith('-----BEGIN RSA PRIVATE KEY-----'): self.private_key = RSA.importKey(key) elif key.startswith('-----BEGIN EC PRIVATE KEY-----'): - self.private_key = ECC.importKey(key) + self.private_key = ECC.import_key(key) else: raise Exception("Unsupported key") @@ -169,7 +176,7 @@ class HttpSigningConfiguration(object): """Converts and returns a datetime object to UNIX time, the number of seconds elapsed since January 1, 1970 UTC. """ - return (ts - datetime.datetime(1970,1,1)).total_seconds() + return (ts - datetime(1970,1,1)).total_seconds() def _get_signed_header_info(self, resource_path, method, headers, body, query_params): """ @@ -178,7 +185,7 @@ class HttpSigningConfiguration(object): :param resource_path : A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method, e.g. GET, POST. :param headers: A dict containing the HTTP request headers. - :param body: The string representation of the HTTP request body. + :param body: The object (e.g. a dict) representing the HTTP request body. :param query_params: A string representing the HTTP request query parameters. :return: A tuple containing two dict objects: The first dict contains the HTTP headers that are used to calculate the HTTP signature. @@ -199,12 +206,12 @@ class HttpSigningConfiguration(object): request_target += "?" + raw_query # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. - now = datetime.datetime.now() + now = datetime.now() stamp = mktime(now.timetuple()) cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) # The '(created)' value MUST be a Unix timestamp integer value. # Subsecond precision is not supported. - created = self._get_unix_time(int(now)) + created = int(self._get_unix_time(now)) if self.signature_max_validity is not None: expires = self._get_unix_time(now + self.signature_max_validity) @@ -218,24 +225,27 @@ class HttpSigningConfiguration(object): value = '{0}'.format(created) elif hdr_key == HEADER_EXPIRES: value = '{0}'.format(expires) - elif hdr_key == HEADER_DATE: + elif hdr_key == HEADER_DATE.lower(): value = cdate request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) - elif hdr_key == HEADER_DIGEST: + elif hdr_key == HEADER_DIGEST.lower(): request_body = body.encode() body_digest, digest_prefix = self._get_message_digest(request_body) b64_body_digest = b64encode(body_digest.digest()) value = digest_prefix + b64_body_digest.decode('ascii') request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( digest_prefix, b64_body_digest.decode('ascii')) - elif hdr_key == HEADER_HOST: + elif hdr_key == HEADER_HOST.lower(): value = target_host request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) else: - value = headers[hdr_key] + value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) + if value is None: + raise Exception("Cannot sign HTTP request. " + "Request does not contain the '{0}' header".format(hdr_key)) signed_headers_dict[hdr_key] = value - return signed_header_dict, request_headers_dict + return signed_headers_dict, request_headers_dict def _get_message_digest(self, data): """ @@ -278,7 +288,7 @@ class HttpSigningConfiguration(object): elif isinstance(self.private_key, ECC.EccKey): if sig_alg is None: sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 - if sig_alg in ECDSA_KEY_SIGNING_ALGORITHMS: + if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: signature = DSS.new(self.private_key, sig_alg).sign(digest) else: raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index e6e32ad9e4d9..899df348d01a 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -12,10 +12,14 @@ """ from collections import namedtuple +from datetime import datetime, timedelta import json import os -import unittest +import re import shutil +import unittest +from Crypto.PublicKey import RSA +from Crypto.PublicKey import ECC import petstore_api from petstore_api import Configuration, signing @@ -61,6 +65,7 @@ 7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== -----END RSA PRIVATE KEY-----""" + class TimeoutWithEqual(urllib3.Timeout): def __init__(self, *arg, **kwargs): super(TimeoutWithEqual, self).__init__(*arg, **kwargs) @@ -68,7 +73,6 @@ def __init__(self, *arg, **kwargs): def __eq__(self, other): return self._read == other._read and self._connect == other._connect and self.total == other.total - class MockPoolManager(object): def __init__(self, tc): self._tc = tc @@ -81,8 +85,26 @@ def request(self, *args, **kwargs): self._tc.assertTrue(len(self._reqs) > 0) r = self._reqs.pop(0) self._tc.maxDiff = None + # r[0] is the expected HTTP method, URL. + # args is the actual HTTP method, URL. self._tc.assertEqual(r[0], args) - self._tc.assertEqual(r[1], kwargs) + # r[1] is a dict that contains the expected body, headers + # kwargs is a dict that contains the actual body, headers + for k, expected in r[1].items(): + self._tc.assertIn(k, kwargs) + actual = kwargs[k] + if k == 'body': + self._tc.assertEqual(expected, actual) + elif k == 'headers': + for expected_header_name, expected_header_value in expected.items(): + self._tc.assertIn(expected_header_name, actual) + actual_header_value = actual[expected_header_name] + pattern = re.compile(expected_header_value) + m = pattern.match(actual_header_value) + self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format( + expected_header_value,actual_header_value)) + elif k == 'timeout': + self._tc.assertEqual(expected, actual) return urllib3.HTTPResponse(status=200, body=b'test') @@ -92,9 +114,6 @@ def setUp(self): self.setUpModels() self.setUpFiles() - def tearDown(self): - if os.path.exists(self.rsa_key_path): - os.unlink(self.rsa_key_path) def setUpModels(self): self.category = petstore_api.Category() @@ -114,12 +133,28 @@ def setUpFiles(self): self.test_file_dir = os.path.realpath(self.test_file_dir) if not os.path.exists(self.test_file_dir): os.mkdir(self.test_file_dir) + self.rsa_key_path = os.path.join(self.test_file_dir, 'rsa.pem') + self.rsa4096_key_path = os.path.join(self.test_file_dir, 'rsa4096.pem') + self.ec_p521_key_path = os.path.join(self.test_file_dir, 'ecP521.pem') + + if not os.path.exists(self.rsa_key_path): + with open(self.rsa_key_path, 'w') as f: + f.write(RSA_TEST_PRIVATE_KEY) + + if not os.path.exists(self.rsa4096_key_path): + key = RSA.generate(4096) + private_key = key.export_key() + with open(self.rsa4096_key_path, "wb") as f: + f.write(private_key) - def test_http_signature(self): - with open(self.rsa_key_path, 'w') as f: - f.write(RSA_TEST_PRIVATE_KEY) + if not os.path.exists(self.ec_p521_key_path): + key = ECC.generate(curve='P-521') + private_key = key.export_key(format='PEM') + with open(self.ec_p521_key_path, "wt") as f: + f.write(private_key) + def test_valid_http_signature(self): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", private_key_path=self.rsa_key_path, @@ -145,20 +180,191 @@ def test_http_signature(self): mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('POST', 'http://localhost/v2/pet', + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + 'headers="\(request-target\) \(created\) host date digest content-type",' + 'signature="[a-zA-Z0-9+/]+="', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_with_defaults(self): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.rsa4096_key_path, + signing_scheme=signing.SCHEME_HS2019, + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + 'headers="\(created\)",' + 'signature="[a-zA-Z0-9+/]+="', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_rsassa_pkcs1v15(self): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.rsa4096_key_path, + signing_scheme=signing.SCHEME_HS2019, + signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + ] + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ', + 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + 'headers="\(request-target\) \(created\)",' + 'signature="[a-zA-Z0-9+/]+="', 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(total=5)) - mock_pool.expect_request('POST', 'http://localhost/v2/pet', + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_rsassa_pss(self): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.rsa4096_key_path, + signing_scheme=signing.SCHEME_HS2019, + signing_algorithm=signing.ALGORITHM_RSASSA_PSS, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + ] + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', - 'Authorization': 'Bearer ', + 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + 'headers="\(request-target\) \(created\)",' + 'signature="[a-zA-Z0-9+/]+="', 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, - preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_valid_http_signature_ec_p521(self): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.ec_p521_key_path, + signing_scheme=signing.SCHEME_HS2019, + signed_headers=[ + signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + ] + ) + config = Configuration(host=HOST, signing_info=signing_cfg) + # Set the OAuth2 acces_token to None. Here we are interested in testing + # the HTTP signature scheme. + config.access_token = None + + api_client = petstore_api.ApiClient(config) + pet_api = petstore_api.PetApi(api_client) + + mock_pool = MockPoolManager(self) + api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', + body=json.dumps(api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + 'headers="\(request-target\) \(created\)",' + 'signature="[a-zA-Z0-9+/]+"', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=None) + + pet_api.add_pet(self.pet) + + def test_invalid_configuration(self): + # Signing scheme must be valid. + with self.assertRaises(Exception): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.ec_p521_key_path, + signing_scheme='foo' + ) + + # Signing scheme must be specified. + with self.assertRaises(Exception): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.ec_p521_key_path + ) + + # File containing private key must exist. + with self.assertRaises(Exception): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path='foobar', + signing_scheme=signing.SCHEME_HS2019 + ) + + # The max validity must be a positive value. + with self.assertRaises(Exception): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.ec_p521_key_path, + signing_scheme=signing.SCHEME_HS2019, + signature_max_validity=timedelta(hours=-1) + ) - pet_api.add_pet(self.pet, _request_timeout=5) - pet_api.add_pet(self.pet, _request_timeout=(1, 2)) + # Cannot include the 'Authorization' header. + with self.assertRaises(Exception): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.ec_p521_key_path, + signing_scheme=signing.SCHEME_HS2019, + signed_headers=['Authorization'] + ) + # Cannot specify duplicate headers. + with self.assertRaises(Exception): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + private_key_path=self.ec_p521_key_path, + signing_scheme=signing.SCHEME_HS2019, + signed_headers=['Host', 'Date', 'Host'] + ) From 5355566335a2c4afb6c2b9296026ec1a04a9db60 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 00:15:33 -0800 Subject: [PATCH 082/102] address review comments --- .../resources/python/python-experimental/api_client.mustache | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index c2eb32d3abe9..2fe04b079e39 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -549,8 +549,6 @@ class ApiClient(object): # The HTTP signature scheme requires multiple HTTP headers # that are calculated dynamically. signing_info = self.configuration.signing_info - # NOTE: no need to raise an exception because this entry only exists - # if signing_info is not None auth_headers = signing_info.get_http_signature_headers( resource_path, method, headers, body, querys) headers.update(auth_headers) From f8dea28d02889b1648bfdc353244610e436dde6d Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 08:21:11 -0800 Subject: [PATCH 083/102] remove http signature from petapi --- .../3_0/petstore-with-fake-endpoints-models-for-testing.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index cf45bf76e379..d747440c1dc4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -43,7 +43,6 @@ paths: '405': description: Invalid input security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -63,7 +62,6 @@ paths: '405': description: Validation exception security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -109,7 +107,6 @@ paths: '400': description: Invalid status value security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' @@ -150,7 +147,6 @@ paths: '400': description: Invalid tag value security: - - http_signature_test: [] - petstore_auth: - 'write:pets' - 'read:pets' From 21e35f0cfeabef0d5cf51043872ea96bd418406d Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 08:23:29 -0800 Subject: [PATCH 084/102] Add separate OAS file with support for HTTP signature --- ...odels-for-testing-with-http-signature.yaml | 1776 +++++++++++++++++ 1 file changed, 1776 insertions(+) create mode 100644 modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml new file mode 100644 index 000000000000..cf45bf76e379 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -0,0 +1,1776 @@ +openapi: 3.0.0 +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: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Someting wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request much reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/test-query-paramters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + 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 + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true From 7fb5c6e014aed227288914aeae611532e96a0657 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 11:30:15 -0800 Subject: [PATCH 085/102] Add support for private key passphrase. Add more unit tests --- bin/openapi3/python-experimental-petstore.sh | 34 +++++++++ .../python-experimental/signing.mustache | 67 ++++++++++++------ .../tests/test_http_signature.py | 69 +++++++++++++------ 3 files changed, 128 insertions(+), 42 deletions(-) create mode 100755 bin/openapi3/python-experimental-petstore.sh diff --git a/bin/openapi3/python-experimental-petstore.sh b/bin/openapi3/python-experimental-petstore.sh new file mode 100755 index 000000000000..71cd902dee57 --- /dev/null +++ b/bin/openapi3/python-experimental-petstore.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +#yaml="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml" +yaml="modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml" +ags="generate -t modules/openapi-generator/src/main/resources/python -i $yaml -g python-experimental -o samples/openapi3/client/petstore/python-experimental/ --additional-properties packageName=petstore_api $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 12e75c0efcf9..8531b4d360a4 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -3,14 +3,15 @@ from __future__ import absolute_import from base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS -from Crypto.Hash import SHA256, SHA512 from datetime import datetime, timedelta from email.utils import formatdate import json import os -import pem +import re from six.moves.urllib.parse import urlencode, urlparse from time import mktime @@ -51,14 +52,16 @@ class HttpSigningConfiguration(object): :param key_id: A string value specifying the identifier of the cryptographic key, when signing HTTP requests. - :param private_key_path: A string value specifying the path of the file containing - a private key. The private key is used to sign HTTP requests. :param signing_scheme: A string value specifying the signature scheme, when signing HTTP requests. Supported value are hs2019, rsa-sha256, rsa-sha512. Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are available for server-side applications that only support the older HTTP signature algorithms. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param private_key_passphrase: A string value specifying the passphrase to decrypt + the private key. :param signed_headers: A list of strings. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. The two special signature headers '(request-target)' and '(created)' SHOULD be @@ -84,17 +87,19 @@ class HttpSigningConfiguration(object): :param signature_max_validity: The signature max validity, expressed as a datetime.timedelta value. It must be a positive value. """ - def __init__(self, key_id, private_key_path, signing_scheme, + def __init__(self, key_id, signing_scheme, private_key_path, + private_key_passphrase=None, signed_headers=None, signing_algorithm=None, signature_max_validity=None): self.key_id = key_id - if not os.path.exists(private_key_path): - raise Exception("Private key file does not exist") - self.private_key_path = private_key_path if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) self.signing_scheme = signing_scheme + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") + self.private_key_path = private_key_path + self.private_key_passphrase = private_key_passphrase self.signing_algorithm = signing_algorithm if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: raise Exception("The signature max validity must be a positive value") @@ -158,19 +163,41 @@ class HttpSigningConfiguration(object): """ if self.private_key is not None: return - with open(self.private_key_path, 'rb') as f: - # Decode PEM file and determine key type from PEM header. - # Supported values are "RSA PRIVATE KEY" and "ECDSA PRIVATE KEY". - keys = pem.parse(f.read()) - if len(keys) != 1: - raise Exception("File must contain exactly one private key") - key = keys[0].as_text() - if key.startswith('-----BEGIN RSA PRIVATE KEY-----'): - self.private_key = RSA.importKey(key) - elif key.startswith('-----BEGIN EC PRIVATE KEY-----'): - self.private_key = ECC.import_key(key) + with open(self.private_key_path, 'r') as f: + pem_data = f.read() + # Verify PEM Pre-Encapsulation Boundary + r = re.compile(r"\s*-----BEGIN (.*)-----\s+") + m = r.match(pem_data) + if not m: + raise ValueError("Not a valid PEM pre boundary") + pem_header = m.group(1) + if pem_header == 'RSA PRIVATE KEY': + self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) + elif pem_header == 'EC PRIVATE KEY': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: + # Key is in PKCS8 format, which is capable of holding many different + # types of private keys, not just EC keys. + (key_binary, pem_header, is_encrypted) = PEM.decode(pem_data, + self.private_key_passphrase) + (oid, privkey, params) = PKCS8.unwrap(key_binary, + passphrase=self.private_key_passphrase) + if oid == '1.2.840.10045.2.1': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + else: + raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) else: - raise Exception("Unsupported key") + raise Exception("Unsupported key: {0}".format(pem_header)) + # Validate the specified signature algorithm is compatible with the private key. + if self.signing_algorithm is not None: + supported_algs = None + if isinstance(self.private_key, RSA.RsaKey): + supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} + elif isinstance(self.private_key, ECC.EccKey): + supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS + if supported_algs is not None and self.signing_algorithm not in supported_algs: + raise Exception("Signing algorithm {0} is " + "not compatible with private key".format(self.signing_algorithm)) def _get_unix_time(self, ts): """Converts and returns a datetime object to UNIX time, the number of seconds diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 899df348d01a..be403d2e1f6d 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -47,7 +47,7 @@ HOST = 'http://localhost/v2' -# Test RSA private key as published in Appendix C 'Test Values' of +# This test RSA private key below is published in Appendix C 'Test Values' of # https://www.ietf.org/id/draft-cavage-http-signatures-12.txt RSA_TEST_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF @@ -97,12 +97,14 @@ def request(self, *args, **kwargs): self._tc.assertEqual(expected, actual) elif k == 'headers': for expected_header_name, expected_header_value in expected.items(): + # Validate the generated request contains the expected header. self._tc.assertIn(expected_header_name, actual) actual_header_value = actual[expected_header_name] + # Compare the actual value of the header against the expected value. pattern = re.compile(expected_header_value) m = pattern.match(actual_header_value) self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format( - expected_header_value,actual_header_value)) + expected_header_value,actual_header_value)) elif k == 'timeout': self._tc.assertEqual(expected, actual) return urllib3.HTTPResponse(status=200, body=b'test') @@ -134,6 +136,7 @@ def setUpFiles(self): if not os.path.exists(self.test_file_dir): os.mkdir(self.test_file_dir) + self.private_key_passphrase = 'test-passphrase' self.rsa_key_path = os.path.join(self.test_file_dir, 'rsa.pem') self.rsa4096_key_path = os.path.join(self.test_file_dir, 'rsa4096.pem') self.ec_p521_key_path = os.path.join(self.test_file_dir, 'ecP521.pem') @@ -144,21 +147,30 @@ def setUpFiles(self): if not os.path.exists(self.rsa4096_key_path): key = RSA.generate(4096) - private_key = key.export_key() + private_key = key.export_key( + passphrase=self.private_key_passphrase, + protection='PEM' + ) with open(self.rsa4096_key_path, "wb") as f: f.write(private_key) if not os.path.exists(self.ec_p521_key_path): key = ECC.generate(curve='P-521') - private_key = key.export_key(format='PEM') + private_key = key.export_key( + format='PEM', + passphrase=self.private_key_passphrase, + use_pkcs8=True, + protection='PBKDF2WithHMAC-SHA1AndAES128-CBC' + ) with open(self.ec_p521_key_path, "wt") as f: f.write(private_key) def test_valid_http_signature(self): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.rsa_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.rsa_key_path, + private_key_passphrase=self.private_key_passphrase, signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, signed_headers=[ signing.HEADER_REQUEST_TARGET, @@ -194,8 +206,9 @@ def test_valid_http_signature(self): def test_valid_http_signature_with_defaults(self): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.rsa4096_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.rsa4096_key_path, + private_key_passphrase=self.private_key_passphrase, ) config = Configuration(host=HOST, signing_info=signing_cfg) # Set the OAuth2 acces_token to None. Here we are interested in testing @@ -222,8 +235,9 @@ def test_valid_http_signature_with_defaults(self): def test_valid_http_signature_rsassa_pkcs1v15(self): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.rsa4096_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.rsa4096_key_path, + private_key_passphrase=self.private_key_passphrase, signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, signed_headers=[ signing.HEADER_REQUEST_TARGET, @@ -255,8 +269,9 @@ def test_valid_http_signature_rsassa_pkcs1v15(self): def test_valid_http_signature_rsassa_pss(self): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.rsa4096_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.rsa4096_key_path, + private_key_passphrase=self.private_key_passphrase, signing_algorithm=signing.ALGORITHM_RSASSA_PSS, signed_headers=[ signing.HEADER_REQUEST_TARGET, @@ -288,8 +303,9 @@ def test_valid_http_signature_rsassa_pss(self): def test_valid_http_signature_ec_p521(self): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.ec_p521_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, + private_key_passphrase=self.private_key_passphrase, signed_headers=[ signing.HEADER_REQUEST_TARGET, signing.HEADER_CREATED, @@ -319,52 +335,61 @@ def test_valid_http_signature_ec_p521(self): def test_invalid_configuration(self): # Signing scheme must be valid. - with self.assertRaises(Exception): + with self.assertRaisesRegex(Exception, 'Unsupported security scheme'): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.ec_p521_key_path, - signing_scheme='foo' + signing_scheme='foo', + private_key_path=self.ec_p521_key_path ) # Signing scheme must be specified. - with self.assertRaises(Exception): + with self.assertRaisesRegex(Exception, 'Unsupported security scheme'): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.ec_p521_key_path + private_key_path=self.ec_p521_key_path, + signing_scheme=None + ) + + # Private key passphrase is missing but key is encrypted. + with self.assertRaisesRegex(Exception, 'Not a valid clear PKCS#8 structure'): + signing_cfg = signing.HttpSigningConfiguration( + key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, ) # File containing private key must exist. - with self.assertRaises(Exception): + with self.assertRaisesRegex(Exception, 'Private key file does not exist'): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", + signing_scheme=signing.SCHEME_HS2019, private_key_path='foobar', - signing_scheme=signing.SCHEME_HS2019 ) # The max validity must be a positive value. - with self.assertRaises(Exception): + with self.assertRaisesRegex(Exception, 'The signature max validity must be a positive value'): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.ec_p521_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, signature_max_validity=timedelta(hours=-1) ) # Cannot include the 'Authorization' header. - with self.assertRaises(Exception): + with self.assertRaisesRegex(Exception, "'Authorization' header cannot be included"): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.ec_p521_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, signed_headers=['Authorization'] ) # Cannot specify duplicate headers. - with self.assertRaises(Exception): + with self.assertRaisesRegex(Exception, 'duplicate'): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", - private_key_path=self.ec_p521_key_path, signing_scheme=signing.SCHEME_HS2019, + private_key_path=self.ec_p521_key_path, signed_headers=['Host', 'Date', 'Host'] ) From 5f4d6c679db62d5650f0c657cb2c93b839bbbd74 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 14:14:17 -0800 Subject: [PATCH 086/102] Add unit test to validate the signature against the public key --- .../python-experimental/signing.mustache | 10 ++ .../tests/test_http_signature.py | 115 ++++++++++++++++-- 2 files changed, 113 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 8531b4d360a4..f323d5285377 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -156,6 +156,16 @@ class HttpSigningConfiguration(object): return request_headers_dict + def get_public_key(self): + """Returns the public key object associated with the private key. + """ + pubkey = None + if isinstance(self.private_key, RSA.RsaKey): + pubkey = self.private_key.publickey() + elif isinstance(self.private_key, ECC.EccKey): + pubkey = self.private_key.public_key() + return pubkey + def _load_private_key(self): """Load the private key used to sign HTTP requests. The private key is used to sign HTTP requests as defined in diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index be403d2e1f6d..02818b49ec31 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -13,13 +13,16 @@ from collections import namedtuple from datetime import datetime, timedelta +import base64 import json import os import re import shutil import unittest -from Crypto.PublicKey import RSA -from Crypto.PublicKey import ECC +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import ECC, RSA +from Crypto.Signature import pkcs1_15, pss, DSS +from six.moves.urllib.parse import urlencode, urlparse import petstore_api from petstore_api import Configuration, signing @@ -81,6 +84,12 @@ def __init__(self, tc): def expect_request(self, *args, **kwargs): self._reqs.append((args, kwargs)) + def set_signing_config(self, signing_cfg): + self.signing_cfg = signing_cfg + self._tc.assertIsNotNone(self.signing_cfg) + self.pubkey = self.signing_cfg.get_public_key() + self._tc.assertIsNotNone(self.pubkey) + def request(self, *args, **kwargs): self._tc.assertTrue(len(self._reqs) > 0) r = self._reqs.pop(0) @@ -92,23 +101,95 @@ def request(self, *args, **kwargs): # kwargs is a dict that contains the actual body, headers for k, expected in r[1].items(): self._tc.assertIn(k, kwargs) - actual = kwargs[k] if k == 'body': - self._tc.assertEqual(expected, actual) + actual_body = kwargs[k] + self._tc.assertEqual(expected, actual_body) elif k == 'headers': + actual_headers = kwargs[k] for expected_header_name, expected_header_value in expected.items(): # Validate the generated request contains the expected header. - self._tc.assertIn(expected_header_name, actual) - actual_header_value = actual[expected_header_name] + self._tc.assertIn(expected_header_name, actual_headers) + actual_header_value = actual_headers[expected_header_name] # Compare the actual value of the header against the expected value. pattern = re.compile(expected_header_value) m = pattern.match(actual_header_value) self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format( expected_header_value,actual_header_value)) + if expected_header_name == 'Authorization': + self._validate_authorization_header( + r[0], actual_headers, actual_header_value) elif k == 'timeout': - self._tc.assertEqual(expected, actual) + self._tc.assertEqual(expected, kwargs[k]) return urllib3.HTTPResponse(status=200, body=b'test') + def _validate_authorization_header(self, request_target, actual_headers, authorization_header): + """Validate the signature. + """ + # Extract (created) + r1 = re.compile(r'created=([0-9]+)') + m1 = r1.search(authorization_header) + self._tc.assertIsNotNone(m1) + created = m1.group(1) + + # Extract list of signed headers + r1 = re.compile(r'headers="([^"]+)"') + m1 = r1.search(authorization_header) + self._tc.assertIsNotNone(m1) + headers = m1.group(1).split(' ') + signed_headers_dict = {} + for h in headers: + if h == '(created)': + signed_headers_dict[h] = created + elif h == '(request-target)': + url = request_target[1] + target_path = urlparse(url).path + signed_headers_dict[h] = "{0} {1}".format(request_target[0].lower(), target_path) + else: + value = next((v for k, v in actual_headers.items() if k.lower() == h), None) + self._tc.assertIsNotNone(value) + signed_headers_dict[h] = value + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + string_to_sign = "\n".join(header_items) + digest = None + if self.signing_cfg.signing_scheme in {signing.SCHEME_RSA_SHA512, signing.SCHEME_HS2019}: + digest = SHA512.new() + elif self.signing_cfg.signing_scheme == signing.SCHEME_RSA_SHA256: + digest = SHA256.new() + else: + self._tc.fail("Unsupported signature scheme: {0}".format(self.signing_cfg.signing_scheme)) + digest.update(string_to_sign.encode()) + b64_body_digest = base64.b64encode(digest.digest()).decode() + + # Extract the signature + r2 = re.compile(r'signature="([^"]+)"') + m2 = r2.search(authorization_header) + self._tc.assertIsNotNone(m2) + b64_signature = m2.group(1) + signature = base64.b64decode(b64_signature) + # Build the message + signing_alg = self.signing_cfg.signing_algorithm + if signing_alg is None: + # Determine default + if isinstance(self.pubkey, RSA.RsaKey): + signing_alg = signing.ALGORITHM_RSASSA_PSS + elif isinstance(self.pubkey, ECC.EccKey): + signing_alg = signing.ALGORITHM_ECDSA_MODE_FIPS_186_3 + else: + self._tc.fail("Unsupported key: {0}".format(type(self.pubkey))) + + if signing_alg == signing.ALGORITHM_RSASSA_PKCS1v15: + pkcs1_15.new(self.pubkey).verify(digest, signature) + elif signing_alg == signing.ALGORITHM_RSASSA_PSS: + pss.new(self.pubkey).verify(digest, signature) + elif signing_alg == signing.ALGORITHM_ECDSA_MODE_FIPS_186_3: + verifier = DSS.new(self.pubkey, signing.ALGORITHM_ECDSA_MODE_FIPS_186_3) + verifier.verify(digest, signature) + elif signing_alg == signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979: + verifier = DSS.new(self.pubkey, signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979) + verifier.verify(digest, signature) + else: + self._tc.fail("Unsupported signing algorithm: {0}".format(signing_alg)) class PetApiTests(unittest.TestCase): @@ -166,10 +247,11 @@ def setUpFiles(self): f.write(private_key) def test_valid_http_signature(self): + privkey_path = self.rsa_key_path signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.rsa_key_path, + private_key_path=privkey_path, private_key_passphrase=self.private_key_passphrase, signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, signed_headers=[ @@ -192,6 +274,7 @@ def test_valid_http_signature(self): mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool + mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', @@ -204,10 +287,11 @@ def test_valid_http_signature(self): pet_api.add_pet(self.pet) def test_valid_http_signature_with_defaults(self): + privkey_path = self.rsa4096_key_path signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.rsa4096_key_path, + private_key_path=privkey_path, private_key_passphrase=self.private_key_passphrase, ) config = Configuration(host=HOST, signing_info=signing_cfg) @@ -221,6 +305,7 @@ def test_valid_http_signature_with_defaults(self): mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool + mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', @@ -233,10 +318,11 @@ def test_valid_http_signature_with_defaults(self): pet_api.add_pet(self.pet) def test_valid_http_signature_rsassa_pkcs1v15(self): + privkey_path = self.rsa4096_key_path signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.rsa4096_key_path, + private_key_path=privkey_path, private_key_passphrase=self.private_key_passphrase, signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15, signed_headers=[ @@ -255,6 +341,7 @@ def test_valid_http_signature_rsassa_pkcs1v15(self): mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool + mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', @@ -267,10 +354,11 @@ def test_valid_http_signature_rsassa_pkcs1v15(self): pet_api.add_pet(self.pet) def test_valid_http_signature_rsassa_pss(self): + privkey_path = self.rsa4096_key_path signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.rsa4096_key_path, + private_key_path=privkey_path, private_key_passphrase=self.private_key_passphrase, signing_algorithm=signing.ALGORITHM_RSASSA_PSS, signed_headers=[ @@ -289,6 +377,7 @@ def test_valid_http_signature_rsassa_pss(self): mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool + mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', @@ -301,10 +390,11 @@ def test_valid_http_signature_rsassa_pss(self): pet_api.add_pet(self.pet) def test_valid_http_signature_ec_p521(self): + privkey_path = self.ec_p521_key_path signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, - private_key_path=self.ec_p521_key_path, + private_key_path=privkey_path, private_key_passphrase=self.private_key_passphrase, signed_headers=[ signing.HEADER_REQUEST_TARGET, @@ -322,6 +412,7 @@ def test_valid_http_signature_ec_p521(self): mock_pool = MockPoolManager(self) api_client.rest_client.pool_manager = mock_pool + mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': 'application/json', From daf060e87fcd77bc819f5f8226b00b65e50cb48e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 14:31:48 -0800 Subject: [PATCH 087/102] remove http signature from petstore-with-fake-endpoints-models-for-testing.yaml --- ...re-with-fake-endpoints-models-for-testing.yaml | 6 ------ .../go-experimental/go-petstore/README.md | 15 --------------- .../go-experimental/go-petstore/api/openapi.yaml | 3 --- 3 files changed, 24 deletions(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index d747440c1dc4..f6f35356afc3 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1168,12 +1168,6 @@ components: type: http scheme: bearer bearerFormat: JWT - http_signature_test: - # Test the 'HTTP signature' security scheme. - # Each HTTP request is cryptographically signed as specified - # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ - type: http - scheme: signature schemas: Foo: type: object diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md index 77a389bf6ad5..d030bad98357 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md @@ -218,21 +218,6 @@ r, err := client.Service.Operation(auth, args) ``` -### http_signature_test - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - - ### petstore_auth diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml index 6fea12f3700a..a138e08ef957 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -2057,6 +2057,3 @@ components: bearerFormat: JWT scheme: bearer type: http - http_signature_test: - scheme: signature - type: http From 9f9f6be473576d69427ad56b7eb75440ce5774a0 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 15:21:00 -0800 Subject: [PATCH 088/102] fix unit test issues --- .../python-experimental/petstore_api/api_client.py | 11 ++++++----- .../petstore_api/models/animal.py | 6 ++---- .../petstore_api/models/array_test.py | 3 +-- .../python-experimental/petstore_api/models/cat.py | 6 ++---- .../petstore_api/models/child.py | 6 ++---- .../petstore_api/models/child_cat.py | 6 ++---- .../petstore_api/models/child_dog.py | 6 ++---- .../petstore_api/models/child_lizard.py | 6 ++---- .../python-experimental/petstore_api/models/dog.py | 6 ++---- .../petstore_api/models/enum_test.py | 3 +-- .../petstore_api/models/file_schema_test_class.py | 3 +-- .../petstore_api/models/map_test.py | 3 +-- ...d_properties_and_additional_properties_class.py | 3 +-- .../petstore_api/models/outer_composite.py | 3 +-- .../petstore_api/models/parent.py | 6 ++---- .../petstore_api/models/parent_pet.py | 12 ++++-------- .../python-experimental/petstore_api/models/pet.py | 6 ++---- .../python-experimental/tests/test_api_client.py | 8 ++++---- .../python-experimental/tests/test_pet_api.py | 14 +++++++------- 19 files changed, 45 insertions(+), 72 deletions(-) diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index eafa0b6e2cf6..1ebbe8969740 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -152,14 +152,14 @@ def __call_api( collection_formats) post_params.extend(self.files_parameters(files)) - # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) - # body if body: body = self.sanitize_for_serialization(body) + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) + # request url if _host is None: url = self.configuration.host + resource_path @@ -520,7 +520,8 @@ def update_params_for_auth(self, headers, querys, auth_settings, :param auth_settings: Authentication setting identifiers list. :resource_path: A string representation of the HTTP request resource path. :method: A string representation of the HTTP request method. - :body: A string representation of the body of the HTTP request. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). """ if not auth_settings: return diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index abb0d49e74c9..2da7a5923a5b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -31,13 +31,11 @@ try: from petstore_api.models import cat except ImportError: - cat = sys.modules[ - 'petstore_api.models.cat'] + cat = sys.modules['petstore_api.models.cat'] try: from petstore_api.models import dog except ImportError: - dog = sys.modules[ - 'petstore_api.models.dog'] + dog = sys.modules['petstore_api.models.dog'] class Animal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index c99bc985cab1..3c15d79a3d01 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -31,8 +31,7 @@ try: from petstore_api.models import read_only_first except ImportError: - read_only_first = sys.modules[ - 'petstore_api.models.read_only_first'] + read_only_first = sys.modules['petstore_api.models.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 229d04455540..6b4985dc4a9b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -31,13 +31,11 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules[ - 'petstore_api.models.animal'] + animal = sys.modules['petstore_api.models.animal'] try: from petstore_api.models import cat_all_of except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.models.cat_all_of'] + cat_all_of = sys.modules['petstore_api.models.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/models/child.py index 9721a0b684f4..8a61f35ba14b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_all_of except ImportError: - child_all_of = sys.modules[ - 'petstore_api.models.child_all_of'] + child_all_of = sys.modules['petstore_api.models.child_all_of'] try: from petstore_api.models import parent except ImportError: - parent = sys.modules[ - 'petstore_api.models.parent'] + parent = sys.modules['petstore_api.models.parent'] class Child(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index 7828dba8cb87..b329281e9c25 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_cat_all_of except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.models.child_cat_all_of'] + child_cat_all_of = sys.modules['petstore_api.models.child_cat_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + parent_pet = sys.modules['petstore_api.models.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index 36180f157134..eaea5cba93c8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_dog_all_of except ImportError: - child_dog_all_of = sys.modules[ - 'petstore_api.models.child_dog_all_of'] + child_dog_all_of = sys.modules['petstore_api.models.child_dog_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + parent_pet = sys.modules['petstore_api.models.parent_pet'] class ChildDog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index cb79d4ad6048..a038974bb543 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -31,13 +31,11 @@ try: from petstore_api.models import child_lizard_all_of except ImportError: - child_lizard_all_of = sys.modules[ - 'petstore_api.models.child_lizard_all_of'] + child_lizard_all_of = sys.modules['petstore_api.models.child_lizard_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules[ - 'petstore_api.models.parent_pet'] + parent_pet = sys.modules['petstore_api.models.parent_pet'] class ChildLizard(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index b29e31d4e5d5..54ccf0e390ab 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -31,13 +31,11 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules[ - 'petstore_api.models.animal'] + animal = sys.modules['petstore_api.models.animal'] try: from petstore_api.models import dog_all_of except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.models.dog_all_of'] + dog_all_of = sys.modules['petstore_api.models.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 42a4c562150c..5df1bcbc2e7d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -31,8 +31,7 @@ try: from petstore_api.models import outer_enum except ImportError: - outer_enum = sys.modules[ - 'petstore_api.models.outer_enum'] + outer_enum = sys.modules['petstore_api.models.outer_enum'] class EnumTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index f1abb16cbc33..62a9a4194a18 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -31,8 +31,7 @@ try: from petstore_api.models import file except ImportError: - file = sys.modules[ - 'petstore_api.models.file'] + file = sys.modules['petstore_api.models.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index e996e27991c1..e6680cc73493 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -31,8 +31,7 @@ try: from petstore_api.models import string_boolean_map except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.models.string_boolean_map'] + string_boolean_map = sys.modules['petstore_api.models.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 60b897624568..52969b942bfa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -31,8 +31,7 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules[ - 'petstore_api.models.animal'] + animal = sys.modules['petstore_api.models.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index 067ac6a14007..013e386adff8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -31,8 +31,7 @@ try: from petstore_api.models import outer_number except ImportError: - outer_number = sys.modules[ - 'petstore_api.models.outer_number'] + outer_number = sys.modules['petstore_api.models.outer_number'] class OuterComposite(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/models/parent.py index 70534d8026eb..4175d7792f63 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent.py @@ -31,13 +31,11 @@ try: from petstore_api.models import grandparent except ImportError: - grandparent = sys.modules[ - 'petstore_api.models.grandparent'] + grandparent = sys.modules['petstore_api.models.grandparent'] try: from petstore_api.models import parent_all_of except ImportError: - parent_all_of = sys.modules[ - 'petstore_api.models.parent_all_of'] + parent_all_of = sys.modules['petstore_api.models.parent_all_of'] class Parent(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index 16d00f42da53..d98bdc6f6570 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -31,23 +31,19 @@ try: from petstore_api.models import child_cat except ImportError: - child_cat = sys.modules[ - 'petstore_api.models.child_cat'] + child_cat = sys.modules['petstore_api.models.child_cat'] try: from petstore_api.models import child_dog except ImportError: - child_dog = sys.modules[ - 'petstore_api.models.child_dog'] + child_dog = sys.modules['petstore_api.models.child_dog'] try: from petstore_api.models import child_lizard except ImportError: - child_lizard = sys.modules[ - 'petstore_api.models.child_lizard'] + child_lizard = sys.modules['petstore_api.models.child_lizard'] try: from petstore_api.models import grandparent_animal except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.models.grandparent_animal'] + grandparent_animal = sys.modules['petstore_api.models.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 11ffa6ff44f5..83b4679eb7a3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -31,13 +31,11 @@ try: from petstore_api.models import category except ImportError: - category = sys.modules[ - 'petstore_api.models.category'] + category = sys.modules['petstore_api.models.category'] try: from petstore_api.models import tag except ImportError: - tag = sys.modules[ - 'petstore_api.models.tag'] + tag = sys.modules['petstore_api.models.tag'] class Pet(ModelNormal): diff --git a/samples/client/petstore/python-experimental/tests/test_api_client.py b/samples/client/petstore/python-experimental/tests/test_api_client.py index aa0b4cac570a..fdf7e05d8385 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_client.py +++ b/samples/client/petstore/python-experimental/tests/test_api_client.py @@ -44,7 +44,7 @@ def test_configuration(self): self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) # test api key auth self.assertEqual(header_params['test1'], 'value1') @@ -59,14 +59,14 @@ def test_configuration(self): config.api_key['api_key'] = '123456' config.api_key_prefix['api_key'] = None # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) self.assertEqual(header_params['api_key'], '123456') # test api key with empty prefix config.api_key['api_key'] = '123456' config.api_key_prefix['api_key'] = '' # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) self.assertEqual(header_params['api_key'], '123456') # test api key with prefix specified in the api_key, useful when the prefix @@ -74,7 +74,7 @@ def test_configuration(self): config.api_key['api_key'] = 'PREFIX=123456' config.api_key_prefix['api_key'] = None # update parameters based on auth setting - client.update_params_for_auth(header_params, query_params, auth_settings) + client.update_params_for_auth(header_params, query_params, auth_settings, resource_path=None, method=None, body=None) self.assertEqual(header_params['api_key'], 'PREFIX=123456') diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 1897c67f4d66..9a0c4f76fa1f 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -119,21 +119,21 @@ def test_preload_content_flag(self): def test_config(self): config = Configuration(host=HOST) self.assertIsNotNone(config.get_host_settings()) - self.assertEquals(config.get_basic_auth_token(), + self.assertEqual(config.get_basic_auth_token(), urllib3.util.make_headers(basic_auth=":").get('authorization')) - self.assertEquals(len(config.auth_settings()), 1) + self.assertEqual(len(config.auth_settings()), 1) self.assertIn("petstore_auth", config.auth_settings().keys()) config.username = "user" config.password = "password" - self.assertEquals( + self.assertEqual( config.get_basic_auth_token(), urllib3.util.make_headers(basic_auth="user:password").get('authorization')) - self.assertEquals(len(config.auth_settings()), 2) + self.assertEqual(len(config.auth_settings()), 2) self.assertIn("petstore_auth", config.auth_settings().keys()) self.assertIn("http_basic_test", config.auth_settings().keys()) config.username = None config.password = None - self.assertEquals(len(config.auth_settings()), 1) + self.assertEqual(len(config.auth_settings()), 1) self.assertIn("petstore_auth", config.auth_settings().keys()) def test_timeout(self): @@ -193,7 +193,7 @@ def test_async_with_result(self): response = thread.get() response2 = thread2.get() - self.assertEquals(response.id, self.pet.id) + self.assertEqual(response.id, self.pet.id) self.assertIsNotNone(response2.id, self.pet.id) def test_async_with_http_info(self): @@ -204,7 +204,7 @@ def test_async_with_http_info(self): data, status, headers = thread.get() self.assertIsInstance(data, petstore_api.Pet) - self.assertEquals(status, 200) + self.assertEqual(status, 200) def test_async_exception(self): self.pet_api.add_pet(self.pet) From c4651cf51247ae9e3ac163c49f6a15f6eb0d7de5 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Fri, 17 Jan 2020 16:22:53 -0800 Subject: [PATCH 089/102] run scripts in bin directory --- samples/openapi3/client/petstore/python/README.md | 5 ----- .../client/petstore/python/petstore_api/configuration.py | 7 ------- 2 files changed, 12 deletions(-) diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index d443a4b3f0a4..45ff3402d25a 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -193,11 +193,6 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication -## http_signature_test - -- **Type**: HTTP basic authentication - - ## petstore_auth - **Type**: OAuth diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 99d8bac4b3d3..1bb8505ee8b5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -350,13 +350,6 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_basic_auth_token() } - if self.signing_info is not None: - auth['http_signature_test'] = { - 'type': 'http-signature', - 'in': 'header', - 'key': 'Authorization', - 'value': None # Signature headers are calculated for every HTTP request - } if self.access_token is not None: auth['petstore_auth'] = { 'type': 'oauth2', From 7b93f5477a717786d51bcecb96e19ea2a2c5b51d Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sun, 19 Jan 2020 15:31:32 -0800 Subject: [PATCH 090/102] Refact unit test with better variable names --- .../tests/test_http_signature.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 02818b49ec31..23022d60f3ea 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -90,22 +90,21 @@ def set_signing_config(self, signing_cfg): self.pubkey = self.signing_cfg.get_public_key() self._tc.assertIsNotNone(self.pubkey) - def request(self, *args, **kwargs): + def request(self, *actual_request_target, **actual_request_headers_and_body): self._tc.assertTrue(len(self._reqs) > 0) - r = self._reqs.pop(0) + expected_results = self._reqs.pop(0) self._tc.maxDiff = None - # r[0] is the expected HTTP method, URL. - # args is the actual HTTP method, URL. - self._tc.assertEqual(r[0], args) - # r[1] is a dict that contains the expected body, headers - # kwargs is a dict that contains the actual body, headers - for k, expected in r[1].items(): - self._tc.assertIn(k, kwargs) + expected_request_target = expected_results[0] # The expected HTTP method and URL path. + expected_request_headers_and_body = expected_results[1] # dict that contains the expected body, headers + self._tc.assertEqual(expected_request_target, actual_request_target) + # actual_request_headers_and_body is a dict that contains the actual body, headers + for k, expected in expected_request_headers_and_body.items(): + self._tc.assertIn(k, actual_request_headers_and_body) if k == 'body': - actual_body = kwargs[k] + actual_body = actual_request_headers_and_body[k] self._tc.assertEqual(expected, actual_body) elif k == 'headers': - actual_headers = kwargs[k] + actual_headers = actual_request_headers_and_body[k] for expected_header_name, expected_header_value in expected.items(): # Validate the generated request contains the expected header. self._tc.assertIn(expected_header_name, actual_headers) @@ -117,9 +116,9 @@ def request(self, *args, **kwargs): expected_header_value,actual_header_value)) if expected_header_name == 'Authorization': self._validate_authorization_header( - r[0], actual_headers, actual_header_value) + expected_request_target, actual_headers, actual_header_value) elif k == 'timeout': - self._tc.assertEqual(expected, kwargs[k]) + self._tc.assertEqual(expected, actual_request_headers_and_body[k]) return urllib3.HTTPResponse(status=200, body=b'test') def _validate_authorization_header(self, request_target, actual_headers, authorization_header): From 34f126fb65077ecf2d23d12907158471c37fc93c Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sun, 19 Jan 2020 21:13:01 -0800 Subject: [PATCH 091/102] do not throw exception if security scheme is unrecognized --- .../src/main/java/org/openapitools/codegen/DefaultCodegen.java | 2 -- 1 file changed, 2 deletions(-) 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 06a286f24f07..acf263be0329 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 @@ -3646,8 +3646,6 @@ public List fromSecurity(Map securitySc // As of January 2020, the "signature" scheme has not been registered with IANA yet. // This scheme may have to be changed when it is officially registered with IANA. cs.isHttpSignature = true; - } else { - throw new RuntimeException("Unsupported security scheme: " + securityScheme.getScheme()); } } else if (SecurityScheme.Type.OAUTH2.equals(securityScheme.getType())) { cs.isKeyInHeader = cs.isKeyInQuery = cs.isKeyInCookie = cs.isApiKey = cs.isBasic = false; From 7b3a54b277601c0c43474b99449ec8046704b800 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 21 Jan 2020 14:53:39 -0800 Subject: [PATCH 092/102] change URL of apache license to use https --- ...h-fake-endpoints-models-for-testing-with-http-signature.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index cf45bf76e379..59d96166c7e2 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -8,7 +8,7 @@ info: title: OpenAPI Petstore license: name: Apache-2.0 - url: 'http://www.apache.org/licenses/LICENSE-2.0.html' + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' tags: - name: pet description: Everything about your Pets From 85d13235beabd8401146259692da782a27189e81 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Tue, 21 Jan 2020 17:05:15 -0800 Subject: [PATCH 093/102] sync from master --- README.md | 6 +- .../windows/python-experimental-petstore.bat | 10 + bin/utils/ensure-up-to-date | 1 + .../release/release_version_update_docs.sh | 2 + docs/generators/README.md | 235 +- docs/generators/ada-server.md | 128 +- docs/generators/ada.md | 128 +- docs/generators/android.md | 154 +- docs/generators/apache2.md | 26 +- docs/generators/apex.md | 256 +- docs/generators/asciidoc.md | 22 +- docs/generators/aspnetcore.md | 254 +- docs/generators/avro-schema.md | 26 +- docs/generators/bash.md | 66 +- docs/generators/c.md | 90 +- docs/generators/clojure.md | 34 +- docs/generators/cpp-pistache-server.md | 10 +- docs/generators/cpp-qt5-client.md | 161 +- docs/generators/cpp-qt5-qhttpengine-server.md | 161 +- docs/generators/cpp-restbed-server.md | 158 +- docs/generators/cpp-restsdk.md | 160 +- docs/generators/cpp-tizen.md | 162 +- docs/generators/csharp-dotnet2.md | 208 +- docs/generators/csharp-nancyfx.md | 76 +- docs/generators/csharp-netcore.md | 239 +- docs/generators/csharp-refactor.md | 29 - docs/generators/csharp.md | 240 +- docs/generators/cwiki.md | 20 +- docs/generators/dart-dio.md | 134 +- docs/generators/dart-jaguar.md | 132 +- docs/generators/dart.md | 128 +- docs/generators/dynamic-html.md | 12 +- docs/generators/eiffel.md | 132 +- docs/generators/elixir.md | 46 +- docs/generators/elm.md | 28 +- docs/generators/erlang-client.md | 62 +- docs/generators/erlang-proper.md | 62 +- docs/generators/erlang-server.md | 62 +- docs/generators/flash.md | 48 +- docs/generators/fsharp-functions.md | 248 +- docs/generators/fsharp-giraffe-server.md | 250 +- docs/generators/fsharp-giraffe.md | 25 - docs/generators/go-experimental.md | 96 +- docs/generators/go-gin-server.md | 86 +- docs/generators/go-server.md | 90 +- docs/generators/go.md | 96 +- .../graphql-nodejs-express-server.md | 46 +- docs/generators/graphql-schema.md | 46 +- docs/generators/graphql-server.md | 12 - docs/generators/groovy.md | 192 +- docs/generators/grpc-schema.md | 9 - docs/generators/haskell-http-client.md | 92 +- docs/generators/haskell.md | 62 +- docs/generators/html.md | 20 +- docs/generators/html2.md | 24 +- docs/generators/java-inflector.md | 190 +- docs/generators/java-msf4j.md | 196 +- docs/generators/java-pkmst.md | 200 +- docs/generators/java-play-framework.md | 200 +- docs/generators/java-undertow-server.md | 190 +- docs/generators/java-vertx-web.md | 190 +- docs/generators/java-vertx.md | 192 +- docs/generators/java.md | 212 +- docs/generators/javascript-closure-angular.md | 82 +- docs/generators/javascript-flowtyped.md | 158 +- docs/generators/javascript.md | 160 +- docs/generators/jaxrs-cxf-cdi.md | 205 +- docs/generators/jaxrs-cxf-client.md | 192 +- docs/generators/jaxrs-cxf-extended.md | 230 +- docs/generators/jaxrs-cxf.md | 220 +- docs/generators/jaxrs-jersey.md | 198 +- docs/generators/jaxrs-resteasy-eap.md | 197 +- docs/generators/jaxrs-resteasy.md | 196 +- docs/generators/jaxrs-spec.md | 204 +- docs/generators/jmeter.md | 26 +- docs/generators/kotlin-server.md | 96 +- docs/generators/kotlin-spring.md | 114 +- docs/generators/kotlin-vertx.md | 84 +- docs/generators/kotlin.md | 92 +- docs/generators/lua.md | 46 +- docs/generators/markdown.md | 26 +- docs/generators/mysql-schema.md | 502 ++-- docs/generators/nim.md | 150 +- docs/generators/nodejs-express-server.md | 74 +- docs/generators/nodejs-server-deprecated.md | 78 +- docs/generators/nodejs-server.md | 16 - docs/generators/objc.md | 120 +- docs/generators/ocaml-client.md | 13 - docs/generators/ocaml.md | 124 +- docs/generators/openapi-yaml.md | 28 +- docs/generators/openapi.md | 26 +- docs/generators/perl.md | 74 +- docs/generators/php-laravel.md | 158 +- docs/generators/php-lumen.md | 158 +- docs/generators/php-silex.md | 132 +- docs/generators/php-slim-deprecated.md | 138 +- docs/generators/php-slim.md | 18 - docs/generators/php-slim4.md | 140 +- docs/generators/php-symfony.md | 144 +- docs/generators/php-ze-ph.md | 158 +- docs/generators/php.md | 140 +- docs/generators/powershell.md | 104 +- docs/generators/protobuf-schema.md | 20 +- docs/generators/python-aiohttp.md | 98 +- docs/generators/python-blueplanet.md | 98 +- docs/generators/python-experimental.md | 90 +- docs/generators/python-flask.md | 98 +- docs/generators/python.md | 88 +- docs/generators/r.md | 34 +- docs/generators/ruby-on-rails.md | 90 +- docs/generators/ruby-sinatra.md | 90 +- docs/generators/ruby.md | 114 +- docs/generators/rust-server.md | 94 +- docs/generators/rust.md | 120 +- docs/generators/scala-akka.md | 102 +- docs/generators/scala-finch.md | 138 +- docs/generators/scala-gatling.md | 120 +- .../generators/scala-httpclient-deprecated.md | 122 +- docs/generators/scala-httpclient.md | 17 - docs/generators/scala-lagom-server.md | 122 +- docs/generators/scala-play-framework.md | 22 - docs/generators/scala-play-server.md | 116 +- docs/generators/scalatra.md | 128 +- docs/generators/scalaz.md | 122 +- docs/generators/spring.md | 228 +- docs/generators/swift2-deprecated.md | 198 +- docs/generators/swift3-deprecated.md | 188 +- docs/generators/swift4.md | 289 ++- docs/generators/swift5.md | 289 ++- docs/generators/typescript-angular.md | 164 +- docs/generators/typescript-angularjs.md | 138 +- docs/generators/typescript-aurelia.md | 140 +- docs/generators/typescript-axios.md | 142 +- docs/generators/typescript-fetch.md | 196 +- docs/generators/typescript-inversify.md | 150 +- docs/generators/typescript-jquery.md | 144 +- docs/generators/typescript-node.md | 148 +- docs/generators/typescript-redux-query.md | 188 +- docs/generators/typescript-rxjs.md | 176 +- docs/installation.md | 14 +- docs/plugins.md | 4 +- .../openapitools/codegen/cmd/ConfigHelp.java | 77 +- .../codegen/cmd/ListGenerators.java | 10 +- .../README.adoc | 2 +- .../build.gradle | 4 +- .../samples/local-spec/build.gradle | 2 +- .../codegen/CodegenConstants.java | 6 + .../openapitools/codegen/DefaultCodegen.java | 9 + .../languages/CSharpNetCoreClientCodegen.java | 27 + .../languages/CppQt5AbstractCodegen.java | 13 + .../languages/DartDioClientCodegen.java | 6 +- .../languages/ErlangClientCodegen.java | 2 +- .../languages/ErlangProperCodegen.java | 2 +- .../JavaJAXRSCXFCDIServerCodegen.java | 2 - .../JavaResteasyEapServerCodegen.java | 1 - .../PythonClientExperimentalCodegen.java | 4 +- .../codegen/languages/Swift4Codegen.java | 2 - .../languages/Swift5ClientCodegen.java | 2 - .../resources/Groovy/build.gradle.mustache | 4 +- .../main/resources/Java/build.gradle.mustache | 4 +- .../libraries/feign/build.gradle.mustache | 2 +- .../google-api-client/build.gradle.mustache | 2 +- .../libraries/jersey2/build.gradle.mustache | 2 +- .../libraries/native/build.gradle.mustache | 4 +- .../okhttp-gson/build.gradle.mustache | 2 +- .../rest-assured/build.gradle.mustache | 2 +- .../libraries/resteasy/build.gradle.mustache | 2 +- .../resttemplate/build.gradle.mustache | 2 +- .../libraries/retrofit/build.gradle.mustache | 2 +- .../libraries/retrofit2/build.gradle.mustache | 2 +- .../libraries/vertx/build.gradle.mustache | 2 +- .../JavaJaxRS/resteasy/eap/gradle.mustache | 2 +- .../JavaJaxRS/resteasy/gradle.mustache | 2 +- .../src/main/resources/android/build.mustache | 2 +- .../android/libraries/volley/build.mustache | 2 +- .../resources/aspnetcore/2.0/model.mustache | 16 +- .../resources/aspnetcore/2.1/model.mustache | 16 +- .../cpp-pistache-server/api-source.mustache | 6 +- .../cpp-qt5-client/CMakeLists.txt.mustache | 5 +- .../cpp-qt5-client/HttpRequest.cpp.mustache | 61 +- .../cpp-qt5-client/HttpRequest.h.mustache | 5 +- .../resources/cpp-qt5-client/Project.mustache | 2 +- .../cpp-qt5-client/api-body.mustache | 9 +- .../cpp-qt5-client/api-header.mustache | 2 + .../resources/csharp-netcore/Project.mustache | 9 +- .../csharp-netcore/netcore_project.mustache | 7 +- .../src/main/resources/dart-dio/api.mustache | 12 +- .../main/resources/dart-dio/apilib.mustache | 1 - .../main/resources/dart-dio/class.mustache | 2 +- .../dart-dio/local_date_serializer.mustache | 50 +- .../resources/dart-dio/serializers.mustache | 7 +- .../resources/go-experimental/api.mustache | 16 +- .../kotlin-client/build.gradle.mustache | 4 +- .../libraries/ktor/build.gradle.mustache | 8 +- .../python/python-experimental/api.mustache | 6 +- .../src/main/resources/r/description.mustache | 2 + .../main/resources/scala-gatling/build.gradle | 2 +- .../scala-httpclient/build.gradle.mustache | 2 +- .../AlamofireImplementations.mustache | 2 +- .../URLSessionImplementations.mustache | 3 +- .../typescript-axios/apiInner.mustache | 4 +- .../codegen/dartdio/DartDioModelTest.java | 6 +- pom.xml | 1 + samples/client/petstore/R/DESCRIPTION | 2 + .../cpp-qt5/.openapi-generator/VERSION | 2 +- .../cpp-qt5/client/PFXHttpRequest.cpp | 34 +- .../petstore/cpp-qt5/client/PFXHttpRequest.h | 5 +- .../petstore/cpp-qt5/client/PFXPetApi.cpp | 23 +- .../petstore/cpp-qt5/client/PFXPetApi.h | 2 + .../petstore/cpp-qt5/client/PFXStoreApi.cpp | 15 +- .../petstore/cpp-qt5/client/PFXStoreApi.h | 2 + .../petstore/cpp-qt5/client/PFXUserApi.cpp | 23 +- .../petstore/cpp-qt5/client/PFXUserApi.h | 2 + .../petstore/cpp-qt5/client/PFXclient.pri | 2 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 5 + .../Org.OpenAPITools/Org.OpenAPITools.csproj | 3 + samples/client/petstore/dart-dio/lib/api.dart | 1 - .../petstore/dart-dio/lib/api/pet_api.dart | 42 +- .../petstore/dart-dio/lib/api/store_api.dart | 16 +- .../petstore/dart-dio/lib/api/user_api.dart | 36 +- .../dart-dio/lib/model/api_response.dart | 6 +- .../dart-dio/lib/model/api_response.g.dart | 41 +- .../petstore/dart-dio/lib/model/category.dart | 4 +- .../dart-dio/lib/model/category.g.dart | 29 +- .../petstore/dart-dio/lib/model/order.dart | 12 +- .../petstore/dart-dio/lib/model/order.g.dart | 77 +- .../petstore/dart-dio/lib/model/pet.dart | 12 +- .../petstore/dart-dio/lib/model/pet.g.dart | 125 +- .../petstore/dart-dio/lib/model/tag.dart | 4 +- .../petstore/dart-dio/lib/model/tag.g.dart | 29 +- .../petstore/dart-dio/lib/model/user.dart | 16 +- .../petstore/dart-dio/lib/model/user.g.dart | 102 +- .../petstore/dart-dio/lib/serializers.g.dart | 8 +- .../go-experimental/go-petstore/api_fake.go | 16 +- samples/client/petstore/groovy/build.gradle | 4 +- .../client/petstore/java/feign/build.gradle | 2 +- .../petstore/java/feign10x/build.gradle | 2 +- .../java/google-api-client/build.gradle | 2 +- .../client/petstore/java/jersey1/build.gradle | 4 +- .../petstore/java/jersey2-java8/build.gradle | 2 +- .../client/petstore/java/jersey2/build.gradle | 2 +- .../client/petstore/java/native/build.gradle | 4 +- .../okhttp-gson-parcelableModel/build.gradle | 2 +- .../petstore/java/okhttp-gson/build.gradle | 2 +- .../petstore/java/rest-assured/build.gradle | 2 +- .../petstore/java/resteasy/build.gradle | 2 +- .../java/resttemplate-withXml/build.gradle | 2 +- .../petstore/java/resttemplate/build.gradle | 2 +- .../petstore/java/retrofit/build.gradle | 2 +- .../java/retrofit2-play24/build.gradle | 2 +- .../java/retrofit2-play25/build.gradle | 2 +- .../java/retrofit2-play26/build.gradle | 2 +- .../petstore/java/retrofit2/build.gradle | 2 +- .../petstore/java/retrofit2rx/build.gradle | 2 +- .../petstore/java/retrofit2rx2/build.gradle | 2 +- .../client/petstore/java/vertx/build.gradle | 2 +- .../petstore/java/webclient/build.gradle | 4 +- .../client/petstore/kotlin-gson/build.gradle | 4 +- .../kotlin-json-request-date/build.gradle | 4 +- .../kotlin-moshi-codegen/build.gradle | 4 +- .../petstore/kotlin-nonpublic/build.gradle | 4 +- .../petstore/kotlin-nullable/build.gradle | 4 +- .../petstore/kotlin-okhttp3/build.gradle | 4 +- .../petstore/kotlin-retrofit2/build.gradle | 4 +- .../petstore/kotlin-string/build.gradle | 4 +- .../petstore/kotlin-threetenbp/build.gradle | 4 +- samples/client/petstore/kotlin/build.gradle | 4 +- .../petstore_api/api/another_fake_api.py | 6 +- .../petstore_api/api/fake_api.py | 198 +- .../api/fake_classname_tags_123_api.py | 6 +- .../petstore_api/api/pet_api.py | 81 +- .../petstore_api/api/store_api.py | 18 +- .../petstore_api/api/user_api.py | 54 +- .../petstore_api/models/animal.py | 6 +- .../petstore_api/models/array_test.py | 3 +- .../petstore_api/models/cat.py | 6 +- .../petstore_api/models/child.py | 6 +- .../petstore_api/models/child_cat.py | 6 +- .../petstore_api/models/child_dog.py | 6 +- .../petstore_api/models/child_lizard.py | 6 +- .../petstore_api/models/dog.py | 6 +- .../petstore_api/models/enum_test.py | 3 +- .../models/file_schema_test_class.py | 3 +- .../petstore_api/models/map_test.py | 3 +- ...perties_and_additional_properties_class.py | 3 +- .../petstore_api/models/outer_composite.py | 3 +- .../petstore_api/models/parent.py | 6 +- .../petstore_api/models/parent_pet.py | 12 +- .../petstore_api/models/pet.py | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/AlamofireImplementations.swift | 2 +- .../swift5/alamofireLibrary/README.md | 2 +- .../swift5/alamofireLibrary/docs/FakeAPI.md | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../petstore/swift5/combineLibrary/README.md | 2 +- .../swift5/combineLibrary/docs/FakeAPI.md | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../client/petstore/swift5/default/README.md | 2 +- .../petstore/swift5/default/docs/FakeAPI.md | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../petstore/swift5/nonPublicApi/README.md | 2 +- .../swift5/nonPublicApi/docs/FakeAPI.md | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../petstore/swift5/objcCompatible/README.md | 2 +- .../swift5/objcCompatible/docs/FakeAPI.md | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../swift5/promisekitLibrary/README.md | 2 +- .../swift5/promisekitLibrary/docs/FakeAPI.md | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../petstore/swift5/resultLibrary/README.md | 2 +- .../swift5/resultLibrary/docs/FakeAPI.md | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../petstore/swift5/rxswiftLibrary/README.md | 2 +- .../swift5/rxswiftLibrary/docs/FakeAPI.md | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 6 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../swift5/urlsessionLibrary/README.md | 2 +- .../swift5/urlsessionLibrary/docs/FakeAPI.md | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 3 +- .../petstore/python-experimental/.gitignore | 66 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../petstore/python-experimental/.travis.yml | 15 + .../petstore/python-experimental/Makefile | 19 + .../petstore/python-experimental/README.md | 210 ++ .../python-experimental/dev-requirements.txt | 2 + .../docs/AdditionalPropertiesClass.md | 11 + .../python-experimental/docs/Animal.md | 11 + .../docs/AnotherFakeApi.md | 63 + .../python-experimental/docs/ApiResponse.md | 12 + .../docs/ArrayOfArrayOfNumberOnly.md | 10 + .../docs/ArrayOfNumberOnly.md | 10 + .../python-experimental/docs/ArrayTest.md | 12 + .../docs/Capitalization.md | 15 + .../petstore/python-experimental/docs/Cat.md | 12 + .../python-experimental/docs/CatAllOf.md | 10 + .../python-experimental/docs/Category.md | 11 + .../python-experimental/docs/ClassModel.md | 11 + .../python-experimental/docs/Client.md | 10 + .../python-experimental/docs/DefaultApi.md | 56 + .../petstore/python-experimental/docs/Dog.md | 12 + .../python-experimental/docs/DogAllOf.md | 10 + .../python-experimental/docs/EnumArrays.md | 11 + .../python-experimental/docs/EnumClass.md | 10 + .../python-experimental/docs/EnumTest.md | 17 + .../python-experimental/docs/FakeApi.md | 849 +++++++ .../docs/FakeClassnameTags123Api.md | 71 + .../petstore/python-experimental/docs/File.md | 11 + .../docs/FileSchemaTestClass.md | 11 + .../petstore/python-experimental/docs/Foo.md | 10 + .../python-experimental/docs/FormatTest.md | 24 + .../docs/HasOnlyReadOnly.md | 11 + .../docs/HealthCheckResult.md | 11 + .../python-experimental/docs/InlineObject.md | 11 + .../python-experimental/docs/InlineObject1.md | 11 + .../python-experimental/docs/InlineObject2.md | 11 + .../python-experimental/docs/InlineObject3.md | 23 + .../python-experimental/docs/InlineObject4.md | 11 + .../python-experimental/docs/InlineObject5.md | 11 + .../docs/InlineResponseDefault.md | 10 + .../petstore/python-experimental/docs/List.md | 10 + .../python-experimental/docs/MapTest.md | 13 + ...dPropertiesAndAdditionalPropertiesClass.md | 12 + .../docs/Model200Response.md | 12 + .../python-experimental/docs/ModelReturn.md | 11 + .../petstore/python-experimental/docs/Name.md | 14 + .../python-experimental/docs/NullableClass.md | 22 + .../python-experimental/docs/NumberOnly.md | 10 + .../python-experimental/docs/Order.md | 15 + .../docs/OuterComposite.md | 12 + .../python-experimental/docs/OuterEnum.md | 10 + .../docs/OuterEnumDefaultValue.md | 10 + .../docs/OuterEnumInteger.md | 10 + .../docs/OuterEnumIntegerDefaultValue.md | 10 + .../petstore/python-experimental/docs/Pet.md | 15 + .../python-experimental/docs/PetApi.md | 597 +++++ .../python-experimental/docs/ReadOnlyFirst.md | 11 + .../docs/SpecialModelName.md | 10 + .../python-experimental/docs/StoreApi.md | 233 ++ .../docs/StringBooleanMap.md | 10 + .../petstore/python-experimental/docs/Tag.md | 11 + .../petstore/python-experimental/docs/User.md | 17 + .../python-experimental/docs/UserApi.md | 437 ++++ .../petstore/python-experimental/git_push.sh | 58 + .../petstore_api/__init__.py | 91 + .../petstore_api/api/__init__.py | 12 + .../petstore_api/api/another_fake_api.py | 378 +++ .../petstore_api/api/default_api.py | 366 +++ .../petstore_api/api/fake_api.py | 2080 +++++++++++++++++ .../api/fake_classname_tags_123_api.py | 380 +++ .../petstore_api/api/pet_api.py | 1319 +++++++++++ .../petstore_api/api/store_api.py | 699 ++++++ .../petstore_api/api/user_api.py | 1130 +++++++++ .../petstore_api/api_client.py | 535 +++++ .../petstore_api/configuration.py | 406 ++++ .../petstore_api/exceptions.py | 120 + .../petstore_api/model_utils.py | 1393 +++++++++++ .../petstore_api/models/__init__.py | 15 + .../models/additional_properties_class.py | 130 ++ .../petstore_api/models/animal.py | 160 ++ .../petstore_api/models/api_response.py | 133 ++ .../models/array_of_array_of_number_only.py | 127 + .../models/array_of_number_only.py | 127 + .../petstore_api/models/array_test.py | 138 ++ .../petstore_api/models/capitalization.py | 142 ++ .../petstore_api/models/cat.py | 180 ++ .../petstore_api/models/cat_all_of.py | 127 + .../petstore_api/models/category.py | 132 ++ .../petstore_api/models/class_model.py | 127 + .../petstore_api/models/client.py | 127 + .../petstore_api/models/dog.py | 180 ++ .../petstore_api/models/dog_all_of.py | 127 + .../petstore_api/models/enum_arrays.py | 138 ++ .../petstore_api/models/enum_class.py | 126 + .../petstore_api/models/enum_test.py | 188 ++ .../petstore_api/models/file.py | 127 + .../models/file_schema_test_class.py | 135 ++ .../petstore_api/models/foo.py | 127 + .../petstore_api/models/format_test.py | 215 ++ .../petstore_api/models/has_only_read_only.py | 130 ++ .../models/health_check_result.py | 127 + .../petstore_api/models/inline_object.py | 130 ++ .../petstore_api/models/inline_object1.py | 130 ++ .../petstore_api/models/inline_object2.py | 139 ++ .../petstore_api/models/inline_object3.py | 205 ++ .../petstore_api/models/inline_object4.py | 133 ++ .../petstore_api/models/inline_object5.py | 132 ++ .../models/inline_response_default.py | 132 ++ .../petstore_api/models/list.py | 127 + .../petstore_api/models/map_test.py | 145 ++ ...perties_and_additional_properties_class.py | 138 ++ .../petstore_api/models/model200_response.py | 130 ++ .../petstore_api/models/model_return.py | 127 + .../petstore_api/models/name.py | 138 ++ .../petstore_api/models/nullable_class.py | 160 ++ .../petstore_api/models/number_only.py | 127 + .../petstore_api/models/order.py | 147 ++ .../petstore_api/models/outer_composite.py | 133 ++ .../petstore_api/models/outer_enum.py | 127 + .../models/outer_enum_default_value.py | 126 + .../petstore_api/models/outer_enum_integer.py | 126 + .../outer_enum_integer_default_value.py | 126 + .../petstore_api/models/pet.py | 160 ++ .../petstore_api/models/read_only_first.py | 130 ++ .../petstore_api/models/special_model_name.py | 127 + .../petstore_api/models/string_boolean_map.py | 124 + .../petstore_api/models/tag.py | 130 ++ .../petstore_api/models/user.py | 148 ++ .../python-experimental/petstore_api/rest.py | 296 +++ .../petstore/python-experimental/pom.xml | 46 + .../python-experimental/requirements.txt | 6 + .../petstore/python-experimental/setup.cfg | 2 + .../petstore/python-experimental/setup.py | 43 + .../python-experimental/test-requirements.txt | 4 + .../python-experimental/test/__init__.py | 0 .../test/test_additional_properties_class.py | 37 + .../python-experimental/test/test_animal.py | 37 + .../test/test_another_fake_api.py | 40 + .../test/test_api_response.py | 37 + .../test_array_of_array_of_number_only.py | 37 + .../test/test_array_of_number_only.py | 37 + .../test/test_array_test.py | 37 + .../test/test_capitalization.py | 37 + .../python-experimental/test/test_cat.py | 37 + .../test/test_cat_all_of.py | 37 + .../python-experimental/test/test_category.py | 37 + .../test/test_class_model.py | 37 + .../python-experimental/test/test_client.py | 37 + .../test/test_default_api.py | 39 + .../python-experimental/test/test_dog.py | 37 + .../test/test_dog_all_of.py | 37 + .../test/test_enum_arrays.py | 37 + .../test/test_enum_class.py | 37 + .../test/test_enum_test.py | 37 + .../python-experimental/test/test_fake_api.py | 124 + .../test/test_fake_classname_tags_123_api.py | 40 + .../python-experimental/test/test_file.py | 37 + .../test/test_file_schema_test_class.py | 37 + .../python-experimental/test/test_foo.py | 37 + .../test/test_format_test.py | 37 + .../test/test_has_only_read_only.py | 37 + .../test/test_health_check_result.py | 37 + .../test/test_inline_object.py | 37 + .../test/test_inline_object1.py | 37 + .../test/test_inline_object2.py | 37 + .../test/test_inline_object3.py | 37 + .../test/test_inline_object4.py | 37 + .../test/test_inline_object5.py | 37 + .../test/test_inline_response_default.py | 37 + .../python-experimental/test/test_list.py | 37 + .../python-experimental/test/test_map_test.py | 37 + ...perties_and_additional_properties_class.py | 37 + .../test/test_model200_response.py | 37 + .../test/test_model_return.py | 37 + .../python-experimental/test/test_name.py | 37 + .../test/test_nullable_class.py | 37 + .../test/test_number_only.py | 37 + .../python-experimental/test/test_order.py | 37 + .../test/test_outer_composite.py | 37 + .../test/test_outer_enum.py | 37 + .../test/test_outer_enum_default_value.py | 37 + .../test/test_outer_enum_integer.py | 37 + .../test_outer_enum_integer_default_value.py | 37 + .../python-experimental/test/test_pet.py | 37 + .../python-experimental/test/test_pet_api.py | 96 + .../test/test_read_only_first.py | 37 + .../test/test_special_model_name.py | 37 + .../test/test_store_api.py | 61 + .../test/test_string_boolean_map.py | 37 + .../python-experimental/test/test_tag.py | 37 + .../python-experimental/test/test_user.py | 37 + .../python-experimental/test/test_user_api.py | 89 + .../python-experimental/test_python2.sh | 33 + .../python-experimental/test_python2_and_3.sh | 31 + .../petstore/python-experimental/tox.ini | 9 + .../openapi_server/openapi/openapi.yaml | 62 +- .../openapi_server/openapi/openapi.yaml | 62 +- .../Org.OpenAPITools/Models/ApiResponse.cs | 2 +- .../src/Org.OpenAPITools/Models/Category.cs | 2 +- .../src/Org.OpenAPITools/Models/Order.cs | 3 +- .../src/Org.OpenAPITools/Models/Pet.cs | 3 +- .../src/Org.OpenAPITools/Models/Tag.cs | 2 +- .../src/Org.OpenAPITools/Models/User.cs | 2 +- .../cpp-pistache/.openapi-generator/VERSION | 2 +- .../petstore/cpp-pistache/api/PetApi.cpp | 12 +- .../petstore/cpp-pistache/api/UserApi.cpp | 12 +- .../jaxrs-resteasy/eap-java8/build.gradle | 2 +- .../jaxrs-resteasy/eap-joda/build.gradle | 2 +- .../petstore/jaxrs-resteasy/eap/build.gradle | 2 +- .../petstore/kotlin-server/ktor/build.gradle | 8 +- website/pages/en/index.js | 5 +- 538 files changed, 31592 insertions(+), 9214 deletions(-) create mode 100644 bin/openapi3/windows/python-experimental-petstore.bat delete mode 100644 docs/generators/csharp-refactor.md delete mode 100644 docs/generators/fsharp-giraffe.md delete mode 100644 docs/generators/graphql-server.md delete mode 100644 docs/generators/grpc-schema.md delete mode 100644 docs/generators/nodejs-server.md delete mode 100644 docs/generators/ocaml-client.md delete mode 100644 docs/generators/php-slim.md delete mode 100644 docs/generators/scala-httpclient.md delete mode 100644 docs/generators/scala-play-framework.md create mode 100644 samples/openapi3/client/petstore/python-experimental/.gitignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION create mode 100644 samples/openapi3/client/petstore/python-experimental/.travis.yml create mode 100644 samples/openapi3/client/petstore/python-experimental/Makefile create mode 100644 samples/openapi3/client/petstore/python-experimental/README.md create mode 100644 samples/openapi3/client/petstore/python-experimental/dev-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Animal.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Cat.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Category.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Client.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Dog.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/File.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Foo.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/List.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MapTest.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Name.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Order.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Pet.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/PetApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/Tag.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/User.md create mode 100644 samples/openapi3/client/petstore/python-experimental/docs/UserApi.md create mode 100644 samples/openapi3/client/petstore/python-experimental/git_push.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py create mode 100644 samples/openapi3/client/petstore/python-experimental/pom.xml create mode 100644 samples/openapi3/client/petstore/python-experimental/requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.cfg create mode 100644 samples/openapi3/client/petstore/python-experimental/setup.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test-requirements.txt create mode 100644 samples/openapi3/client/petstore/python-experimental/test/__init__.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_animal.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_api_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_array_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_category.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_class_model.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_client.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_default_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_foo.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_format_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_list.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_map_test.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_model_return.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_number_only.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_order.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_store_api.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_tag.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user.py create mode 100644 samples/openapi3/client/petstore/python-experimental/test/test_user_api.py create mode 100755 samples/openapi3/client/petstore/python-experimental/test_python2.sh create mode 100755 samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh create mode 100644 samples/openapi3/client/petstore/python-experimental/tox.ini diff --git a/README.md b/README.md index 72a9973d44e1..6a5a81e89665 100644 --- a/README.md +++ b/README.md @@ -395,10 +395,10 @@ openapi-generator version ``` -Or install a particular OpenAPI Generator version (e.g. v4.1.2): +Or install a particular OpenAPI Generator version (e.g. v4.2.2): ```sh -npm install @openapitools/openapi-generator-cli@cli-4.1.2 -g +npm install @openapitools/openapi-generator-cli@cli-4.2.2 -g ``` Or install it as dev-dependency: @@ -622,6 +622,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [RedHat](https://www.redhat.com) - [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development) - [REST United](https://restunited.com) +- [Robotinfra](https://www.robotinfra.com) - [Sony Interactive Entertainment](https://www.sie.com/en/index.html) - [Stingray](http://www.stingray.com) - [Suva](https://www.suva.ch/) @@ -721,6 +722,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2019-12-17 - [OpenAPI Generator で OAuth2 アクセストークン発行のコードまで生成してみる](https://www.techscore.com/blog/2019/12/17/openapi-generator-oauth2-accesstoken/) by [TECHSCORE](https://www.techscore.com/blog/) - 2019-12-23 - [Use Ada for Your Web Development](https://www.electronicdesign.com/technologies/embedded-revolution/article/21119177/use-ada-for-your-web-development) by [Stephane Carrez](https://github.com/stcarrez) - 2019-01-17 - [OpenAPI demo for Pulp 3.0 GA](https://www.youtube.com/watch?v=mFBP-M0ZPfw&t=178s) by [Pulp](https://www.youtube.com/channel/UCI43Ffs4VPDv7awXvvBJfRQ) at [Youtube](https://www.youtube.com/) +- 2019-01-19 - [Why document a REST API as code?](https://dev.to/rolfstreefkerk/why-document-a-rest-api-as-code-5e7p) by [Rolf Streefkerk](https://github.com/rpstreef) at [DEV Community](https://dev.to) ## [6 - About Us](#table-of-contents) diff --git a/bin/openapi3/windows/python-experimental-petstore.bat b/bin/openapi3/windows/python-experimental-petstore.bat new file mode 100644 index 000000000000..73c433de2784 --- /dev/null +++ b/bin/openapi3/windows/python-experimental-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples\openapi3\client\petstore\python-experimental --additional-properties packageName=petstore_api + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 397b6975a1a1..4bb9ee79b4f2 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -41,6 +41,7 @@ declare -a samples=( "${root}/bin/python-petstore-all.sh" "${root}/bin/python-server-all.sh" "${root}/bin/openapi3/python-petstore.sh" +"${root}/bin/openapi3/python-experimental-petstore.sh" "${root}/bin/php-petstore.sh" "${root}/bin/php-silex-petstore-server.sh" "${root}/bin/php-symfony-petstore.sh" diff --git a/bin/utils/release/release_version_update_docs.sh b/bin/utils/release/release_version_update_docs.sh index 9a47f86bbf08..cfd66070e95f 100755 --- a/bin/utils/release/release_version_update_docs.sh +++ b/bin/utils/release/release_version_update_docs.sh @@ -105,6 +105,8 @@ declare -a xml_files=( "${root}/modules/openapi-generator-maven-plugin/README.md" "${root}/modules/openapi-generator-gradle-plugin/samples/local-spec/README.md" "${root}/README.md" + "${root}/docs/installation.md" + "${root}/website/pages/en/index.js" ) declare -a commented_files=( diff --git a/docs/generators/README.md b/docs/generators/README.md index 070ef96c15e2..cd9e5f551c71 100644 --- a/docs/generators/README.md +++ b/docs/generators/README.md @@ -1,123 +1,138 @@ + The following generators are available: -* CLIENT generators: - - [ada](ada.md) - - [android](android.md) - - [apex](apex.md) - - [bash](bash.md) - - [c](c.md) - - [clojure](clojure.md) - - [cpp-qt5-client](cpp-qt5-client.md) - - [cpp-restsdk](cpp-restsdk.md) - - [cpp-tizen](cpp-tizen.md) - - [csharp](csharp.md) - - [csharp-dotnet2](csharp-dotnet2.md) - - [csharp-refactor](csharp-refactor.md) - - [dart](dart.md) - - [dart-dio](dart-dio.md) - - [dart-jaguar](dart-jaguar.md) - - [eiffel](eiffel.md) - - [elixir](elixir.md) - - [elm](elm.md) - - [erlang-client](erlang-client.md) - - [erlang-proper](erlang-proper.md) - - [flash](flash.md) - - [go](go.md) - - [groovy](groovy.md) - - [haskell-http-client](haskell-http-client.md) - - [java](java.md) - - [javascript](javascript.md) - - [javascript-closure-angular](javascript-closure-angular.md) - - [javascript-flowtyped](javascript-flowtyped.md) - - [jaxrs-cxf-client](jaxrs-cxf-client.md) - - [jmeter](jmeter.md) - - [kotlin](kotlin.md) - - [lua](lua.md) - - [objc](objc.md) - - [perl](perl.md) - - [php](php.md) - - [powershell](powershell.md) - - [python](python.md) - - [r](r.md) - - [ruby](ruby.md) - - [rust](rust.md) - - [scala-akka](scala-akka.md) - - [scala-gatling](scala-gatling.md) - - [scala-httpclient](scala-httpclient.md) - - [scalaz](scalaz.md) - - [swift2-deprecated](swift2-deprecated.md) - - [swift3-deprecated](swift3-deprecated.md) - - [swift4](swift4.md) - - [typescript-angular](typescript-angular.md) - - [typescript-angularjs](typescript-angularjs.md) - - [typescript-aurelia](typescript-aurelia.md) - - [typescript-axios](typescript-axios.md) - - [typescript-fetch](typescript-fetch.md) - - [typescript-inversify](typescript-inversify.md) - - [typescript-jquery](typescript-jquery.md) - - [typescript-node](typescript-node.md) - - [typescript-rxjs](typescript-rxjs.md) +## CLIENT generators +* [ada](ada.md) +* [android](android.md) +* [apex](apex.md) +* [bash](bash.md) +* [c](c.md) +* [clojure](clojure.md) +* [cpp-qt5-client](cpp-qt5-client.md) +* [cpp-restsdk](cpp-restsdk.md) +* [cpp-tizen](cpp-tizen.md) +* [csharp](csharp.md) +* [csharp-netcore](csharp-netcore.md) +* [dart](dart.md) +* [dart-dio](dart-dio.md) +* [dart-jaguar](dart-jaguar.md) +* [eiffel](eiffel.md) +* [elixir](elixir.md) +* [elm](elm.md) +* [erlang-client](erlang-client.md) +* [erlang-proper](erlang-proper.md) +* [flash](flash.md) +* [go](go.md) +* [go-experimental (experimental)](go-experimental.md) +* [groovy](groovy.md) +* [haskell-http-client](haskell-http-client.md) +* [java](java.md) +* [javascript](javascript.md) +* [javascript-closure-angular](javascript-closure-angular.md) +* [javascript-flowtyped](javascript-flowtyped.md) +* [jaxrs-cxf-client](jaxrs-cxf-client.md) +* [jmeter](jmeter.md) +* [kotlin](kotlin.md) +* [lua](lua.md) +* [nim (beta)](nim.md) +* [objc](objc.md) +* [ocaml](ocaml.md) +* [perl](perl.md) +* [php](php.md) +* [powershell](powershell.md) +* [python](python.md) +* [python-experimental (experimental)](python-experimental.md) +* [r](r.md) +* [ruby](ruby.md) +* [rust](rust.md) +* [scala-akka](scala-akka.md) +* [scala-gatling](scala-gatling.md) +* [scalaz](scalaz.md) +* [swift4](swift4.md) +* [swift5 (beta)](swift5.md) +* [typescript-angular](typescript-angular.md) +* [typescript-angularjs](typescript-angularjs.md) +* [typescript-aurelia](typescript-aurelia.md) +* [typescript-axios](typescript-axios.md) +* [typescript-fetch](typescript-fetch.md) +* [typescript-inversify](typescript-inversify.md) +* [typescript-jquery](typescript-jquery.md) +* [typescript-node](typescript-node.md) +* [typescript-redux-query](typescript-redux-query.md) +* [typescript-rxjs](typescript-rxjs.md) -* SERVER generators: - - [ada-server](ada-server.md) - - [aspnetcore](aspnetcore.md) - - [cpp-pistache-server](cpp-pistache-server.md) - - [cpp-qt5-qhttpengine-server](cpp-qt5-qhttpengine-server.md) - - [cpp-restbed-server](cpp-restbed-server.md) - - [csharp-nancyfx](csharp-nancyfx.md) - - [erlang-server](erlang-server.md) - - [go-gin-server](go-gin-server.md) - - [go-server](go-server.md) - - [graphql-server](graphql-server.md) - - [haskell](haskell.md) - - [java-inflector](java-inflector.md) - - [java-msf4j](java-msf4j.md) - - [java-pkmst](java-pkmst.md) - - [java-play-framework](java-play-framework.md) - - [java-undertow-server](java-undertow-server.md) - - [java-vertx](java-vertx.md) - - [jaxrs-cxf](jaxrs-cxf.md) - - [jaxrs-cxf-cdi](jaxrs-cxf-cdi.md) - - [jaxrs-jersey](jaxrs-jersey.md) - - [jaxrs-resteasy](jaxrs-resteasy.md) - - [jaxrs-resteasy-eap](jaxrs-resteasy-eap.md) - - [jaxrs-spec](jaxrs-spec.md) - - [kotlin-server](kotlin-server.md) - - [kotlin-spring](kotlin-spring.md) - - [nodejs-server](nodejs-server.md) - - [php-laravel](php-laravel.md) - - [php-lumen](php-lumen.md) - - [php-silex](php-silex.md) - - [php-slim](php-slim.md) - - [php-symfony](php-symfony.md) - - [php-ze-ph](php-ze-ph.md) - - [python-flask](python-flask.md) - - [ruby-on-rails](ruby-on-rails.md) - - [ruby-sinatra](ruby-sinatra.md) - - [rust-server](rust-server.md) - - [scala-finch](scala-finch.md) - - [scala-lagom-server](scala-lagom-server.md) - - [scalatra](scalatra.md) - - [spring](spring.md) +## SERVER generators +* [ada-server](ada-server.md) +* [aspnetcore](aspnetcore.md) +* [cpp-pistache-server](cpp-pistache-server.md) +* [cpp-qt5-qhttpengine-server](cpp-qt5-qhttpengine-server.md) +* [cpp-restbed-server](cpp-restbed-server.md) +* [csharp-nancyfx](csharp-nancyfx.md) +* [erlang-server](erlang-server.md) +* [fsharp-functions (beta)](fsharp-functions.md) +* [fsharp-giraffe-server (beta)](fsharp-giraffe-server.md) +* [go-gin-server](go-gin-server.md) +* [go-server](go-server.md) +* [graphql-nodejs-express-server](graphql-nodejs-express-server.md) +* [haskell](haskell.md) +* [java-inflector](java-inflector.md) +* [java-msf4j](java-msf4j.md) +* [java-pkmst](java-pkmst.md) +* [java-play-framework](java-play-framework.md) +* [java-undertow-server](java-undertow-server.md) +* [java-vertx](java-vertx.md) +* [java-vertx-web (beta)](java-vertx-web.md) +* [jaxrs-cxf](jaxrs-cxf.md) +* [jaxrs-cxf-cdi](jaxrs-cxf-cdi.md) +* [jaxrs-cxf-extended](jaxrs-cxf-extended.md) +* [jaxrs-jersey](jaxrs-jersey.md) +* [jaxrs-resteasy](jaxrs-resteasy.md) +* [jaxrs-resteasy-eap](jaxrs-resteasy-eap.md) +* [jaxrs-spec](jaxrs-spec.md) +* [kotlin-server](kotlin-server.md) +* [kotlin-spring](kotlin-spring.md) +* [kotlin-vertx (beta)](kotlin-vertx.md) +* [nodejs-express-server (beta)](nodejs-express-server.md) +* [php-laravel](php-laravel.md) +* [php-lumen](php-lumen.md) +* [php-silex](php-silex.md) +* [php-slim4](php-slim4.md) +* [php-symfony](php-symfony.md) +* [php-ze-ph](php-ze-ph.md) +* [python-aiohttp](python-aiohttp.md) +* [python-blueplanet](python-blueplanet.md) +* [python-flask](python-flask.md) +* [ruby-on-rails](ruby-on-rails.md) +* [ruby-sinatra](ruby-sinatra.md) +* [rust-server](rust-server.md) +* [scala-finch](scala-finch.md) +* [scala-lagom-server](scala-lagom-server.md) +* [scala-play-server](scala-play-server.md) +* [scalatra](scalatra.md) +* [spring](spring.md) -* DOCUMENTATION generators: - - [cwiki](cwiki.md) - - [dynamic-html](dynamic-html.md) - - [html](html.md) - - [html2](html2.md) - - [openapi](openapi.md) - - [openapi-yaml](openapi-yaml.md) +## DOCUMENTATION generators +* [asciidoc](asciidoc.md) +* [cwiki](cwiki.md) +* [dynamic-html](dynamic-html.md) +* [html](html.md) +* [html2](html2.md) +* [markdown (beta)](markdown.md) +* [openapi](openapi.md) +* [openapi-yaml](openapi-yaml.md) -* SCHEMA generators: - - [mysql-schema](mysql-schema.md) +## SCHEMA generators +* [avro-schema (beta)](avro-schema.md) +* [mysql-schema](mysql-schema.md) -* CONFIG generators: - - [apache2](apache2.md) - - [graphql-schema](graphql-schema.md) +## CONFIG generators +* [apache2](apache2.md) +* [graphql-schema](graphql-schema.md) +* [protobuf-schema (beta)](protobuf-schema.md) diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index 174e3fca5f0b..61f5b1c53e2d 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -5,12 +5,12 @@ sidebar_label: ada-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING @@ -26,88 +26,88 @@ sidebar_label: ada-server ## LANGUAGE PRIMITIVES -
  • Integer
  • -
  • boolean
  • +
    • Boolean
    • Character
    • +
    • Integer
    • +
    • boolean
    • double
    • -
    • integer
    • -
    • Boolean
    • float
    • +
    • integer
    • long
    ## RESERVED WORDS -
    • exception
    • -
    • synchronized
    • +
      • abort
      • +
      • abs
      • +
      • abstract
      • +
      • accept
      • +
      • access
      • +
      • aliased
      • +
      • all
      • +
      • and
      • +
      • array
      • +
      • at
      • +
      • begin
      • +
      • body
      • +
      • case
      • constant
      • -
      • mod
      • -
      • select
      • declare
      • -
      • separate
      • -
      • use
      • +
      • delay
      • +
      • digits
      • do
      • -
      • elsif
      • -
      • body
      • -
      • type
      • -
      • while
      • -
      • when
      • -
      • aliased
      • -
      • protected
      • -
      • tagged
      • else
      • -
      • loop
      • -
      • function
      • -
      • record
      • -
      • raise
      • -
      • rem
      • -
      • if
      • -
      • case
      • -
      • others
      • -
      • all
      • -
      • new
      • -
      • package
      • -
      • in
      • -
      • is
      • -
      • then
      • -
      • pragma
      • -
      • accept
      • +
      • elsif
      • +
      • end
      • entry
      • +
      • exception
      • exit
      • -
      • at
      • -
      • delay
      • -
      • task
      • -
      • null
      • -
      • abort
      • -
      • overriding
      • -
      • terminate
      • -
      • begin
      • -
      • some
      • -
      • private
      • -
      • access
      • for
      • -
      • range
      • +
      • function
      • +
      • generic
      • +
      • goto
      • +
      • if
      • +
      • in
      • interface
      • -
      • out
      • +
      • is
      • +
      • limited
      • +
      • loop
      • +
      • mod
      • +
      • new
      • not
      • -
      • goto
      • -
      • array
      • -
      • subtype
      • -
      • and
      • +
      • null
      • of
      • -
      • end
      • -
      • xor
      • or
      • -
      • limited
      • -
      • abstract
      • +
      • others
      • +
      • out
      • +
      • overriding
      • +
      • package
      • +
      • pragma
      • +
      • private
      • procedure
      • -
      • reverse
      • -
      • generic
      • +
      • protected
      • +
      • raise
      • +
      • range
      • +
      • record
      • +
      • rem
      • renames
      • requeue
      • -
      • with
      • -
      • abs
      • -
      • digits
      • -
      • until
      • return
      • +
      • reverse
      • +
      • select
      • +
      • separate
      • +
      • some
      • +
      • subtype
      • +
      • synchronized
      • +
      • tagged
      • +
      • task
      • +
      • terminate
      • +
      • then
      • +
      • type
      • +
      • until
      • +
      • use
      • +
      • when
      • +
      • while
      • +
      • with
      • +
      • xor
      diff --git a/docs/generators/ada.md b/docs/generators/ada.md index 4e11f7b5aa0c..60d6a74739d6 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -5,12 +5,12 @@ sidebar_label: ada | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING @@ -26,88 +26,88 @@ sidebar_label: ada ## LANGUAGE PRIMITIVES -
      • Integer
      • -
      • boolean
      • +
        • Boolean
        • Character
        • +
        • Integer
        • +
        • boolean
        • double
        • -
        • integer
        • -
        • Boolean
        • float
        • +
        • integer
        • long
        ## RESERVED WORDS -
        • exception
        • -
        • synchronized
        • +
          • abort
          • +
          • abs
          • +
          • abstract
          • +
          • accept
          • +
          • access
          • +
          • aliased
          • +
          • all
          • +
          • and
          • +
          • array
          • +
          • at
          • +
          • begin
          • +
          • body
          • +
          • case
          • constant
          • -
          • mod
          • -
          • select
          • declare
          • -
          • separate
          • -
          • use
          • +
          • delay
          • +
          • digits
          • do
          • -
          • elsif
          • -
          • body
          • -
          • type
          • -
          • while
          • -
          • when
          • -
          • aliased
          • -
          • protected
          • -
          • tagged
          • else
          • -
          • loop
          • -
          • function
          • -
          • record
          • -
          • raise
          • -
          • rem
          • -
          • if
          • -
          • case
          • -
          • others
          • -
          • all
          • -
          • new
          • -
          • package
          • -
          • in
          • -
          • is
          • -
          • then
          • -
          • pragma
          • -
          • accept
          • +
          • elsif
          • +
          • end
          • entry
          • +
          • exception
          • exit
          • -
          • at
          • -
          • delay
          • -
          • task
          • -
          • null
          • -
          • abort
          • -
          • overriding
          • -
          • terminate
          • -
          • begin
          • -
          • some
          • -
          • private
          • -
          • access
          • for
          • -
          • range
          • +
          • function
          • +
          • generic
          • +
          • goto
          • +
          • if
          • +
          • in
          • interface
          • -
          • out
          • +
          • is
          • +
          • limited
          • +
          • loop
          • +
          • mod
          • +
          • new
          • not
          • -
          • goto
          • -
          • array
          • -
          • subtype
          • -
          • and
          • +
          • null
          • of
          • -
          • end
          • -
          • xor
          • or
          • -
          • limited
          • -
          • abstract
          • +
          • others
          • +
          • out
          • +
          • overriding
          • +
          • package
          • +
          • pragma
          • +
          • private
          • procedure
          • -
          • reverse
          • -
          • generic
          • +
          • protected
          • +
          • raise
          • +
          • range
          • +
          • record
          • +
          • rem
          • renames
          • requeue
          • -
          • with
          • -
          • abs
          • -
          • digits
          • -
          • until
          • return
          • +
          • reverse
          • +
          • select
          • +
          • separate
          • +
          • some
          • +
          • subtype
          • +
          • synchronized
          • +
          • tagged
          • +
          • task
          • +
          • terminate
          • +
          • then
          • +
          • type
          • +
          • until
          • +
          • use
          • +
          • when
          • +
          • while
          • +
          • with
          • +
          • xor
          diff --git a/docs/generators/android.md b/docs/generators/android.md index 5af5bd026928..8bcc419aa7a3 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -5,45 +5,45 @@ sidebar_label: android | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| +|androidBuildToolsVersion|buildToolsVersion version for use in the generated build.gradle| |null| +|androidGradleVersion|gradleVersion version for use in the generated build.gradle| |null| +|androidSdkVersion|compileSdkVersion version for use in the generated build.gradle| |null| |apiPackage|package for generated api classes| |null| -|invokerPackage|root package for generated code| |null| -|groupId|groupId for use in the generated build.gradle and pom.xml| |null| |artifactId|artifactId for use in the generated build.gradle and pom.xml| |null| |artifactVersion|artifact version for use in the generated build.gradle and pom.xml| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|groupId|groupId for use in the generated build.gradle and pom.xml| |null| +|invokerPackage|root package for generated code| |null| +|library|library template (sub-template) to use|
          **volley**
          HTTP client: Volley 1.0.19 (default)
          **httpclient**
          HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be depecreated in the next major release.
          |null| +|modelPackage|package for generated models| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |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| |useAndroidMavenGradlePlugin|A flag to toggle android-maven gradle plugin.| |true| -|androidGradleVersion|gradleVersion version for use in the generated build.gradle| |null| -|androidSdkVersion|compileSdkVersion version for use in the generated build.gradle| |null| -|androidBuildToolsVersion|buildToolsVersion version for use in the generated build.gradle| |null| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|library|library template (sub-template) to use|
          **volley**
          HTTP client: Volley 1.0.19 (default)
          **httpclient**
          HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be depecreated in the next major release.
          |null| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -56,81 +56,81 @@ sidebar_label: android ## LANGUAGE PRIMITIVES -
          • Integer
          • -
          • byte[]
          • +
            • Boolean
            • +
            • Double
            • Float
            • -
            • boolean
            • +
            • Integer
            • Long
            • Object
            • String
            • -
            • Boolean
            • -
            • Double
            • +
            • boolean
            • +
            • byte[]
            ## RESERVED WORDS -
            • synchronized
            • +
              • abstract
              • +
              • apiinvoker
              • +
              • assert
              • +
              • authnames
              • basepath
              • -
              • do
              • -
              • float
              • -
              • while
              • -
              • localvarpath
              • -
              • protected
              • -
              • continue
              • -
              • else
              • -
              • localvarqueryparams
              • -
              • catch
              • -
              • if
              • +
              • boolean
              • +
              • break
              • +
              • byte
              • case
              • -
              • new
              • -
              • package
              • -
              • static
              • -
              • void
              • +
              • catch
              • +
              • char
              • +
              • class
              • +
              • const
              • +
              • continue
              • +
              • default
              • +
              • do
              • double
              • -
              • byte
              • -
              • finally
              • -
              • this
              • -
              • strictfp
              • -
              • throws
              • +
              • else
              • enum
              • extends
              • -
              • null
              • -
              • transient
              • final
              • -
              • try
              • -
              • localvarbuilder
              • -
              • object
              • -
              • localvarcontenttypes
              • +
              • finally
              • +
              • float
              • +
              • for
              • +
              • goto
              • +
              • if
              • implements
              • -
              • private
              • import
              • -
              • const
              • -
              • for
              • +
              • instanceof
              • +
              • int
              • interface
              • -
              • long
              • -
              • switch
              • -
              • default
              • -
              • goto
              • -
              • public
              • -
              • localvarheaderparams
              • -
              • native
              • +
              • localvarbuilder
              • localvarcontenttype
              • -
              • apiinvoker
              • -
              • assert
              • -
              • class
              • +
              • localvarcontenttypes
              • localvarformparams
              • -
              • break
              • +
              • localvarheaderparams
              • +
              • localvarpath
              • +
              • localvarpostbody
              • +
              • localvarqueryparams
              • localvarresponse
              • -
              • volatile
              • -
              • abstract
              • -
              • int
              • -
              • instanceof
              • +
              • long
              • +
              • native
              • +
              • new
              • +
              • null
              • +
              • object
              • +
              • package
              • +
              • private
              • +
              • protected
              • +
              • public
              • +
              • return
              • +
              • short
              • +
              • static
              • +
              • strictfp
              • super
              • -
              • boolean
              • +
              • switch
              • +
              • synchronized
              • +
              • this
              • throw
              • -
              • localvarpostbody
              • -
              • char
              • -
              • short
              • -
              • authnames
              • -
              • return
              • +
              • throws
              • +
              • transient
              • +
              • try
              • +
              • void
              • +
              • volatile
              • +
              • while
              diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index 1c431f4e36b7..80dbcb60ff3f 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -5,33 +5,33 @@ sidebar_label: apache2 | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| |userInfoPath|Path to the user and group files| |null| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES diff --git a/docs/generators/apex.md b/docs/generators/apex.md index 414f2b11883b..d80fb0f3fe4d 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -5,15 +5,15 @@ sidebar_label: apex | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|classPrefix|Prefix for generated classes. Set this to avoid overwriting existing classes in your org.| |null| |apiVersion|The Metadata API version number to use for components in this package.| |null| |buildMethod|The build method for this package.| |null| +|classPrefix|Prefix for generated classes. Set this to avoid overwriting existing classes in your org.| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |namedCredential|The named credential name for the HTTP callouts| |null| +|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| ## IMPORT MAPPING @@ -32,155 +32,155 @@ sidebar_label: apex ## LANGUAGE PRIMITIVES
              • Blob
              • -
              • Time
              • -
              • String
              • -
              • Double
              • +
              • Boolean
              • Date
              • -
              • Integer
              • +
              • Datetime
              • Decimal
              • +
              • Double
              • +
              • ID
              • +
              • Integer
              • Long
              • Object
              • -
              • ID
              • -
              • Boolean
              • -
              • Datetime
              • +
              • String
              • +
              • Time
              ## RESERVED WORDS -
              • exception
              • -
              • select
              • -
              • commit
              • -
              • type
              • -
              • when
              • -
              • cast
              • -
              • number
              • -
              • protected
              • -
              • else
              • -
              • merge
              • -
              • next_90_days
              • -
              • catch
              • -
              • join
              • -
              • if
              • -
              • case
              • -
              • using
              • -
              • having
              • -
              • last_month
              • -
              • in
              • -
              • byte
              • -
              • outer
              • -
              • tomorrow
              • -
              • upsert
              • -
              • then
              • -
              • enum
              • -
              • exit
              • +
                • abstract
                • +
                • activate
                • +
                • and
                • +
                • any
                • +
                • array
                • as
                • -
                • system
                • -
                • bulk
                • +
                • asc
                • +
                • autonomous
                • begin
                • -
                • object
                • -
                • global
                • -
                • long
                • -
                • next_week
                • -
                • into
                • -
                • default
                • -
                • search
                • -
                • goto
                • -
                • by
                • -
                • currency
                • -
                • where
                • -
                • override
                • -
                • map
                • -
                • rollback
                • -
                • stat
                • -
                • set
                • +
                • bigdecimal
                • +
                • blob
                • break
                • -
                • last_90_days
                • -
                • abstract
                • -
                • trigger
                • -
                • this_week
                • -
                • asc
                • -
                • testmethod
                • -
                • throw
                • -
                • future
                • -
                • returning
                • +
                • bulk
                • +
                • by
                • +
                • byte
                • +
                • case
                • +
                • cast
                • +
                • catch
                • char
                • -
                • webservice
                • -
                • return
                • -
                • transaction
                • +
                • class
                • +
                • collect
                • +
                • commit
                • +
                • const
                • +
                • continue
                • +
                • convertcurrency
                • +
                • currency
                • date
                • -
                • synchronized
                • -
                • tolabel
                • -
                • nulls
                • -
                • next_month
                • -
                • autonomous
                • +
                • datetime
                • +
                • decimal
                • +
                • default
                • +
                • delete
                • +
                • desc
                • do
                • +
                • else
                • +
                • end
                • +
                • enum
                • +
                • exception
                • +
                • exit
                • +
                • export
                • +
                • extends
                • +
                • false
                • +
                • final
                • +
                • finally
                • float
                • -
                • while
                • -
                • datetime
                • -
                • continue
                • -
                • loop
                • -
                • limit
                • +
                • for
                • from
                • -
                • export
                • +
                • future
                • +
                • global
                • +
                • goto
                • group
                • -
                • new
                • -
                • package
                • -
                • static
                • -
                • like
                • -
                • finally
                • -
                • this
                • -
                • sort
                • -
                • list
                • -
                • inner
                • -
                • pragma
                • -
                • blob
                • -
                • this_month
                • -
                • convertcurrency
                • -
                • extends
                • -
                • null
                • +
                • having
                • hint
                • -
                • activate
                • -
                • final
                • -
                • true
                • -
                • retrieve
                • -
                • undelete
                • -
                • try
                • -
                • decimal
                • -
                • collect
                • -
                • next_n_days
                • -
                • desc
                • +
                • if
                • implements
                • -
                • private
                • -
                • virtual
                • -
                • const
                • import
                • -
                • for
                • +
                • in
                • +
                • inner
                • insert
                • -
                • update
                • +
                • instanceof
                • +
                • int
                • interface
                • -
                • delete
                • -
                • switch
                • -
                • yesterday
                • +
                • into
                • +
                • join
                • +
                • last_90_days
                • +
                • last_month
                • +
                • last_n_days
                • +
                • last_week
                • +
                • like
                • +
                • limit
                • +
                • list
                • +
                • long
                • +
                • loop
                • +
                • map
                • +
                • merge
                • +
                • new
                • +
                • next_90_days
                • +
                • next_month
                • +
                • next_n_days
                • +
                • next_week
                • not
                • -
                • public
                • -
                • array
                • -
                • parallel
                • -
                • savepoint
                • -
                • and
                • +
                • null
                • +
                • nulls
                • +
                • number
                • +
                • object
                • of
                • -
                • today
                • -
                • end
                • -
                • class
                • on
                • or
                • -
                • bigdecimal
                • -
                • false
                • -
                • any
                • -
                • int
                • -
                • instanceof
                • -
                • super
                • -
                • last_n_days
                • +
                • outer
                • +
                • override
                • +
                • package
                • +
                • parallel
                • +
                • pragma
                • +
                • private
                • +
                • protected
                • +
                • public
                • +
                • retrieve
                • +
                • return
                • +
                • returning
                • +
                • rollback
                • +
                • savepoint
                • +
                • search
                • +
                • select
                • +
                • set
                • short
                • +
                • sort
                • +
                • stat
                • +
                • static
                • +
                • super
                • +
                • switch
                • +
                • synchronized
                • +
                • system
                • +
                • testmethod
                • +
                • then
                • +
                • this
                • +
                • this_month
                • +
                • this_week
                • +
                • throw
                • time
                • -
                • last_week
                • +
                • today
                • +
                • tolabel
                • +
                • tomorrow
                • +
                • transaction
                • +
                • trigger
                • +
                • true
                • +
                • try
                • +
                • type
                • +
                • undelete
                • +
                • update
                • +
                • upsert
                • +
                • using
                • +
                • virtual
                • +
                • webservice
                • +
                • when
                • +
                • where
                • +
                • while
                • +
                • yesterday
                diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index fc7a99c1820a..9243aafaceb1 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -5,24 +5,24 @@ sidebar_label: asciidoc | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|appName|short name of the application| |null| |appDescription|description of the application| |null| -|infoUrl|a URL where users can get more information about the application| |null| +|appName|short name of the application| |null| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|groupId|groupId in generated pom.xml| |null| +|headerAttributes|generation of asciidoc header meta data attributes (set to false to suppress, default: true)| |true| |infoEmail|an email address to contact for inquiries about the application| |null| +|infoUrl|a URL where users can get more information about the application| |null| +|invokerPackage|root package for generated code| |null| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| -|invokerPackage|root package for generated code| |null| -|groupId|groupId in generated pom.xml| |null| -|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snippetDir|path with includable markup snippets (e.g. test output generated by restdoc, default: .)| |.| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |specDir|path with includable markup spec files (e.g. handwritten additional docs, default: ..)| |..| -|headerAttributes|generation of asciidoc header meta data attributes (set to false to suppress, default: true)| |true| ## IMPORT MAPPING diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 25d5b2ad5c7a..eda0e8a9f26f 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -5,37 +5,37 @@ sidebar_label: aspnetcore | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|licenseUrl|The URL of the license| |http://localhost| +|aspnetCoreVersion|ASP.NET Core version: 3.0 (preview4 only), 2.2, 2.1, 2.0 (deprecated)| |2.2| +|buildTarget|Target to build an application or library| |program| +|classModifier|Class Modifier can be empty, abstract| || +|compatibilityVersion|ASP.Net Core CompatibilityVersion| |Version_2_2| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| +|enumValueSuffix|Suffix that will be appended to all enum values.| |Enum| +|generateBody|Generates method body.| |true| +|isLibrary|Is the build a library| |false| |licenseName|The name of the license| |NoLicense| -|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| +|licenseUrl|The URL of the license| |http://localhost| +|modelClassModifier|Model Class Modifier can be nothing or partial| |partial| +|newtonsoftVersion|Version for Microsoft.AspNetCore.Mvc.NewtonsoftJson for ASP.NET Core 3.0+| |3.0.0-preview5-19227-01| +|operationIsAsync|Set methods to async or sync (default).| |false| +|operationModifier|Operation Modifier can be virtual, abstract or partial| |virtual| +|operationResultTask|Set methods result to Task<>.| |false| |packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| -|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| +|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| +|packageGuid|The GUID that will be associated with the C# project| |null| |packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| +|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| |packageVersion|C# package version.| |1.0.0| -|packageGuid|The GUID that will be associated with the C# project| |null| +|returnICollection|Return ICollection<T> instead of the concrete type.| |false| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sourceFolder|source folder for generated code| |src| -|compatibilityVersion|ASP.Net Core CompatibilityVersion| |Version_2_2| -|aspnetCoreVersion|ASP.NET Core version: 3.0 (preview4 only), 2.2, 2.1, 2.0 (deprecated)| |2.2| |swashbuckleVersion|Swashbucke version: 3.0.0, 4.0.0| |3.0.0| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |true| -|isLibrary|Is the build a library| |false| +|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| +|useDefaultRouting|Use default routing for the ASP.NET Core version. For 3.0 turn off default because it is not yet supported.| |true| |useFrameworkReference|Use frameworkReference for ASP.NET Core 3.0+ and PackageReference ASP.NET Core 2.2 or earlier.| |false| |useNewtonsoft|Uses the Newtonsoft JSON library.| |true| -|newtonsoftVersion|Version for Microsoft.AspNetCore.Mvc.NewtonsoftJson for ASP.NET Core 3.0+| |3.0.0-preview5-19227-01| -|useDefaultRouting|Use default routing for the ASP.NET Core version. For 3.0 turn off default because it is not yet supported.| |true| -|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| -|enumValueSuffix|Suffix that will be appended to all enum values.| |Enum| -|classModifier|Class Modifier can be empty, abstract| || -|operationModifier|Operation Modifier can be virtual, abstract or partial| |virtual| -|buildTarget|Target to build an application or library| |program| -|generateBody|Generates method body.| |true| -|operationIsAsync|Set methods to async or sync (default).| |false| -|operationResultTask|Set methods result to Task<>.| |false| -|modelClassModifier|Model Class Modifier can be nothing or partial| |partial| +|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |true| ## IMPORT MAPPING @@ -54,138 +54,138 @@ sidebar_label: aspnetcore ## LANGUAGE PRIMITIVES -
                • int?
                • -
                • Dictionary
                • -
                • string
                • -
                • bool
                • -
                • DateTimeOffset?
                • -
                • String
                • -
                • Guid
                • -
                • System.IO.Stream
                • -
                • bool?
                • -
                • float
                • -
                • long
                • +
                  • Boolean
                  • +
                  • Collection
                  • DateTime
                  • -
                  • Int32
                  • -
                  • float?
                  • DateTime?
                  • -
                  • List
                  • -
                  • Boolean
                  • -
                  • long?
                  • -
                  • double
                  • -
                  • Guid?
                  • DateTimeOffset
                  • +
                  • DateTimeOffset?
                  • +
                  • Dictionary
                  • Double
                  • -
                  • int
                  • -
                  • byte[]
                  • Float
                  • -
                  • Int64
                  • -
                  • double?
                  • +
                  • Guid
                  • +
                  • Guid?
                  • ICollection
                  • -
                  • Collection
                  • +
                  • Int32
                  • +
                  • Int64
                  • +
                  • List
                  • Object
                  • -
                  • decimal?
                  • +
                  • String
                  • +
                  • System.IO.Stream
                  • +
                  • bool
                  • +
                  • bool?
                  • +
                  • byte[]
                  • decimal
                  • +
                  • decimal?
                  • +
                  • double
                  • +
                  • double?
                  • +
                  • float
                  • +
                  • float?
                  • +
                  • int
                  • +
                  • int?
                  • +
                  • long
                  • +
                  • long?
                  • +
                  • string
                  ## RESERVED WORDS -
                  • struct
                  • -
                  • ushort
                  • -
                  • localVarQueryParams
                  • -
                  • protected
                  • -
                  • readonly
                  • -
                  • else
                  • -
                  • lock
                  • -
                  • localVarPathParams
                  • -
                  • catch
                  • -
                  • if
                  • -
                  • case
                  • -
                  • localVarHttpHeaderAccepts
                  • -
                  • using
                  • -
                  • localVarPostBody
                  • -
                  • in
                  • +
                    • Client
                    • +
                    • abstract
                    • +
                    • as
                    • +
                    • async
                    • +
                    • await
                    • +
                    • base
                    • +
                    • bool
                    • +
                    • break
                    • byte
                    • +
                    • case
                    • +
                    • catch
                    • +
                    • char
                    • +
                    • checked
                    • +
                    • class
                    • +
                    • client
                    • +
                    • const
                    • +
                    • continue
                    • +
                    • decimal
                    • +
                    • default
                    • +
                    • delegate
                    • +
                    • do
                    • double
                    • -
                    • var
                    • -
                    • is
                    • -
                    • params
                    • +
                    • dynamic
                    • +
                    • else
                    • enum
                    • +
                    • event
                    • explicit
                    • -
                    • as
                    • -
                    • object
                    • +
                    • extern
                    • +
                    • false
                    • +
                    • finally
                    • +
                    • fixed
                    • +
                    • float
                    • +
                    • for
                    • +
                    • foreach
                    • +
                    • goto
                    • +
                    • if
                    • implicit
                    • +
                    • in
                    • +
                    • int
                    • +
                    • interface
                    • internal
                    • +
                    • is
                    • +
                    • localVarFileParams
                    • +
                    • localVarFormParams
                    • +
                    • localVarHeaderParams
                    • +
                    • localVarHttpContentType
                    • +
                    • localVarHttpContentTypes
                    • localVarHttpHeaderAccept
                    • -
                    • unsafe
                    • +
                    • localVarHttpHeaderAccepts
                    • +
                    • localVarPath
                    • +
                    • localVarPathParams
                    • +
                    • localVarPostBody
                    • +
                    • localVarQueryParams
                    • +
                    • localVarResponse
                    • +
                    • localVarStatusCode
                    • +
                    • lock
                    • long
                    • +
                    • namespace
                    • +
                    • new
                    • +
                    • null
                    • +
                    • object
                    • +
                    • operator
                    • out
                    • -
                    • delegate
                    • -
                    • default
                    • -
                    • goto
                    • -
                    • localVarHttpContentTypes
                    • -
                    • localVarHttpContentType
                    • -
                    • yield
                    • override
                    • -
                    • event
                    • -
                    • typeof
                    • -
                    • break
                    • -
                    • abstract
                    • -
                    • uint
                    • -
                    • throw
                    • -
                    • char
                    • -
                    • sbyte
                    • -
                    • localVarFileParams
                    • -
                    • return
                    • -
                    • extern
                    • -
                    • do
                    • -
                    • float
                    • -
                    • while
                    • -
                    • operator
                    • +
                    • parameter
                    • +
                    • params
                    • +
                    • private
                    • +
                    • protected
                    • +
                    • public
                    • +
                    • readonly
                    • ref
                    • -
                    • continue
                    • -
                    • checked
                    • -
                    • dynamic
                    • -
                    • Client
                    • -
                    • new
                    • -
                    • static
                    • -
                    • void
                    • -
                    • sizeof
                    • -
                    • localVarResponse
                    • +
                    • return
                    • +
                    • sbyte
                    • sealed
                    • -
                    • finally
                    • +
                    • short
                    • +
                    • sizeof
                    • +
                    • stackalloc
                    • +
                    • static
                    • +
                    • string
                    • +
                    • struct
                    • +
                    • switch
                    • this
                    • -
                    • unchecked
                    • -
                    • null
                    • -
                    • localVarPath
                    • +
                    • throw
                    • true
                    • -
                    • fixed
                    • try
                    • -
                    • decimal
                    • -
                    • private
                    • -
                    • virtual
                    • -
                    • bool
                    • -
                    • const
                    • -
                    • string
                    • -
                    • for
                    • -
                    • interface
                    • -
                    • switch
                    • -
                    • foreach
                    • +
                    • typeof
                    • +
                    • uint
                    • ulong
                    • -
                    • public
                    • -
                    • localVarStatusCode
                    • -
                    • stackalloc
                    • -
                    • parameter
                    • -
                    • await
                    • -
                    • client
                    • -
                    • class
                    • -
                    • localVarFormParams
                    • -
                    • false
                    • +
                    • unchecked
                    • +
                    • unsafe
                    • +
                    • ushort
                    • +
                    • using
                    • +
                    • var
                    • +
                    • virtual
                    • +
                    • void
                    • volatile
                    • -
                    • int
                    • -
                    • async
                    • -
                    • localVarHeaderParams
                    • -
                    • namespace
                    • -
                    • short
                    • -
                    • base
                    • +
                    • while
                    • +
                    • yield
                    diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index 480f11bd1b8f..45256f48950b 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -5,12 +5,12 @@ sidebar_label: avro-schema | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |packageName|package for generated classes (where supported)| |null| +|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| ## IMPORT MAPPING @@ -29,20 +29,20 @@ sidebar_label: avro-schema ## LANGUAGE PRIMITIVES -
                    • date
                    • -
                    • string
                    • +
                      • BigDecimal
                      • +
                      • DateTime
                      • +
                      • UUID
                      • +
                      • boolean
                      • +
                      • bytes
                      • +
                      • date
                      • double
                      • -
                      • integer
                      • float
                      • int
                      • +
                      • integer
                      • long
                      • -
                      • BigDecimal
                      • -
                      • DateTime
                      • -
                      • number
                      • -
                      • boolean
                      • null
                      • -
                      • bytes
                      • -
                      • UUID
                      • +
                      • number
                      • +
                      • string
                      ## RESERVED WORDS diff --git a/docs/generators/bash.md b/docs/generators/bash.md index daee782196fd..c56cbd4047ab 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -5,40 +5,40 @@ sidebar_label: bash | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|apiKeyAuthEnvironmentVariable|Name of environment variable where API key can be defined (e.g. PETSTORE_APIKEY='kjhasdGASDa5asdASD')| |false| +|basicAuthEnvironmentVariable|Name of environment variable where username and password can be defined (e.g. PETSTORE_CREDS='username:password')| |null| |curlOptions|Default cURL options| |null| -|processMarkdown|Convert all Markdown Markup into terminal formatting| |false| -|scriptName|The name of the script that will be generated (e.g. petstore-cli)| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |generateBashCompletion|Whether to generate the Bash completion script| |false| |generateZshCompletion|Whether to generate the Zsh completion script| |false| |hostEnvironmentVariable|Name of environment variable where host can be defined (e.g. PETSTORE_HOST='http://api.openapitools.org:8080')| |null| -|basicAuthEnvironmentVariable|Name of environment variable where username and password can be defined (e.g. PETSTORE_CREDS='username:password')| |null| -|apiKeyAuthEnvironmentVariable|Name of environment variable where API key can be defined (e.g. PETSTORE_APIKEY='kjhasdGASDa5asdASD')| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|processMarkdown|Convert all Markdown Markup into terminal formatting| |false| +|scriptName|The name of the script that will be generated (e.g. petstore-cli)| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -49,31 +49,31 @@ sidebar_label: bash ## LANGUAGE PRIMITIVES -
                      • boolean
                      • -
                      • string
                      • -
                      • array
                      • +
                        • array
                        • binary
                        • -
                        • integer
                        • +
                        • boolean
                        • float
                        • +
                        • integer
                        • map
                        • +
                        • string
                        ## RESERVED WORDS -
                        • fi
                        • -
                        • select
                        • -
                        • in
                        • -
                        • for
                        • +
                          • case
                          • do
                          • -
                          • elif
                          • -
                          • then
                          • -
                          • while
                          • done
                          • +
                          • elif
                          • else
                          • +
                          • esac
                          • +
                          • fi
                          • +
                          • for
                          • function
                          • -
                          • until
                          • -
                          • time
                          • if
                          • -
                          • case
                          • -
                          • esac
                          • +
                          • in
                          • +
                          • select
                          • +
                          • then
                          • +
                          • time
                          • +
                          • until
                          • +
                          • while
                          diff --git a/docs/generators/c.md b/docs/generators/c.md index 41c7e123c5fb..400db5b79a3b 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -5,12 +5,12 @@ sidebar_label: c | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|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| ## IMPORT MAPPING @@ -26,63 +26,63 @@ sidebar_label: c ## LANGUAGE PRIMITIVES -
                          • binary_t*
                          • -
                          • double
                          • +
                            • Object
                            • +
                            • binary_t*
                            • char
                            • -
                            • short
                            • -
                            • Object
                            • +
                            • double
                            • float
                            • -
                            • list
                            • int
                            • -
                            • long
                            • +
                            • list
                            • list_t*
                            • +
                            • long
                            • +
                            • short
                            ## RESERVED WORDS -
                            • struct
                            • -
                            • auto
                            • -
                            • const
                            • -
                            • _static_assert
                            • +
                              • _alignas
                              • +
                              • _alignof
                              • _atomic
                              • +
                              • _bool
                              • _complex
                              • -
                              • for
                              • -
                              • extern
                              • -
                              • do
                              • -
                              • float
                              • -
                              • restrict
                              • -
                              • while
                              • -
                              • long
                              • -
                              • remove
                              • -
                              • switch
                              • _generic
                              • -
                              • default
                              • -
                              • _alignof
                              • -
                              • goto
                              • -
                              • continue
                              • -
                              • else
                              • +
                              • _imaginary
                              • _noreturn
                              • -
                              • if
                              • -
                              • case
                              • -
                              • _bool
                              • -
                              • static
                              • -
                              • void
                              • +
                              • _static_assert
                              • +
                              • _thread_local
                              • +
                              • auto
                              • break
                              • -
                              • sizeof
                              • +
                              • case
                              • +
                              • char
                              • +
                              • const
                              • +
                              • continue
                              • +
                              • default
                              • +
                              • do
                              • double
                              • -
                              • signed
                              • -
                              • volatile
                              • -
                              • union
                              • -
                              • _thread_local
                              • -
                              • typedef
                              • +
                              • else
                              • enum
                              • -
                              • int
                              • +
                              • extern
                              • +
                              • float
                              • +
                              • for
                              • +
                              • goto
                              • +
                              • if
                              • inline
                              • -
                              • _alignas
                              • -
                              • _imaginary
                              • -
                              • char
                              • +
                              • int
                              • +
                              • long
                              • +
                              • register
                              • +
                              • remove
                              • +
                              • restrict
                              • +
                              • return
                              • short
                              • +
                              • signed
                              • +
                              • sizeof
                              • +
                              • static
                              • +
                              • struct
                              • +
                              • switch
                              • +
                              • typedef
                              • +
                              • union
                              • unsigned
                              • -
                              • return
                              • -
                              • register
                              • +
                              • void
                              • +
                              • volatile
                              • +
                              • while
                              diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index 3c0d64a47d25..ce4976940427 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -5,39 +5,39 @@ sidebar_label: clojure | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|baseNamespace|the base/top namespace (Default: generated from projectName)| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|projectName|name of the project (Default: generated from info.title or "openapi-clj-client")| |null| |projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null| -|projectVersion|version of the project (Default: using info.version or "1.0.0")| |null| -|projectUrl|URL of the project (Default: using info.contact.url or not included in project.clj)| |null| |projectLicenseName|name of the license the project uses (Default: using info.license.name or not included in project.clj)| |null| |projectLicenseUrl|URL of the license the project uses (Default: using info.license.url or not included in project.clj)| |null| -|baseNamespace|the base/top namespace (Default: generated from projectName)| |null| +|projectName|name of the project (Default: generated from info.title or "openapi-clj-client")| |null| +|projectUrl|URL of the project (Default: using info.contact.url or not included in project.clj)| |null| +|projectVersion|version of the project (Default: using info.version or "1.0.0")| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES diff --git a/docs/generators/cpp-pistache-server.md b/docs/generators/cpp-pistache-server.md index f74eafd5b239..fde4459144b3 100644 --- a/docs/generators/cpp-pistache-server.md +++ b/docs/generators/cpp-pistache-server.md @@ -13,10 +13,10 @@ sidebar_label: cpp-pistache-server | Type/Alias | Imports | | ---------- | ------- | -|std::vector|#include <vector>| +|Object|#include "Object.h"| |std::map|#include <map>| |std::string|#include <string>| -|Object|#include "Object.h"| +|std::vector|#include <vector>| ## INSTANTIATION TYPES @@ -28,13 +28,13 @@ sidebar_label: cpp-pistache-server ## LANGUAGE PRIMITIVES
                              • bool
                              • -
                              • double
                              • char
                              • +
                              • double
                              • float
                              • -
                              • int64_t
                              • int
                              • -
                              • long
                              • int32_t
                              • +
                              • int64_t
                              • +
                              • long
                              ## RESERVED WORDS diff --git a/docs/generators/cpp-qt5-client.md b/docs/generators/cpp-qt5-client.md index 31f3f31b7706..5677ef13d085 100644 --- a/docs/generators/cpp-qt5-client.md +++ b/docs/generators/cpp-qt5-client.md @@ -5,14 +5,15 @@ sidebar_label: cpp-qt5-client | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|contentCompression|Enable Compressed Content Encoding for requests and responses| |false| |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |optionalProjectFile|Generate client.pri.| |true| +|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| ## IMPORT MAPPING @@ -29,104 +30,104 @@ sidebar_label: cpp-qt5-client ## LANGUAGE PRIMITIVES -
                              • QDateTime
                              • +
                                • QByteArray
                                • +
                                • QDate
                                • +
                                • QDateTime
                                • QString
                                • -
                                • qint64
                                • -
                                • qint32
                                • bool
                                • -
                                • QByteArray
                                • double
                                • -
                                • QDate
                                • float
                                • +
                                • qint32
                                • +
                                • qint64
                                ## RESERVED WORDS -
                                • struct
                                • +
                                  • alignas
                                  • +
                                  • alignof
                                  • +
                                  • and
                                  • +
                                  • and_eq
                                  • +
                                  • asm
                                  • auto
                                  • -
                                  • xor_eq
                                  • +
                                  • bitand
                                  • +
                                  • bitor
                                  • +
                                  • bool
                                  • +
                                  • break
                                  • +
                                  • case
                                  • +
                                  • catch
                                  • +
                                  • char
                                  • +
                                  • char16_t
                                  • +
                                  • char32_t
                                  • +
                                  • class
                                  • +
                                  • compl
                                  • +
                                  • concept
                                  • +
                                  • const
                                  • const_cast
                                  • -
                                  • decltype
                                  • -
                                  • alignas
                                  • -
                                  • extern
                                  • -
                                  • do
                                  • -
                                  • float
                                  • -
                                  • while
                                  • constexpr
                                  • -
                                  • operator
                                  • -
                                  • bitand
                                  • -
                                  • protected
                                  • continue
                                  • +
                                  • decltype
                                  • +
                                  • default
                                  • +
                                  • delete
                                  • +
                                  • do
                                  • +
                                  • double
                                  • +
                                  • dynamic_cast
                                  • else
                                  • -
                                  • friend
                                  • -
                                  • mutable
                                  • -
                                  • compl
                                  • -
                                  • typeid
                                  • -
                                  • catch
                                  • +
                                  • enum
                                  • +
                                  • explicit
                                  • export
                                  • +
                                  • extern
                                  • +
                                  • false
                                  • +
                                  • float
                                  • +
                                  • for
                                  • +
                                  • friend
                                  • +
                                  • goto
                                  • if
                                  • -
                                  • case
                                  • -
                                  • dynamic_cast
                                  • -
                                  • not_eq
                                  • +
                                  • inline
                                  • +
                                  • int
                                  • +
                                  • linux
                                  • +
                                  • long
                                  • +
                                  • mutable
                                  • +
                                  • namespace
                                  • new
                                  • -
                                  • using
                                  • -
                                  • static
                                  • -
                                  • void
                                  • -
                                  • sizeof
                                  • -
                                  • bitor
                                  • -
                                  • double
                                  • -
                                  • this
                                  • -
                                  • signed
                                  • noexcept
                                  • -
                                  • typedef
                                  • -
                                  • enum
                                  • -
                                  • char16_t
                                  • -
                                  • explicit
                                  • -
                                  • static_cast
                                  • -
                                  • true
                                  • -
                                  • try
                                  • -
                                  • reinterpret_cast
                                  • +
                                  • not
                                  • +
                                  • not_eq
                                  • nullptr
                                  • -
                                  • requires
                                  • -
                                  • template
                                  • +
                                  • operator
                                  • +
                                  • or
                                  • +
                                  • or_eq
                                  • private
                                  • -
                                  • virtual
                                  • -
                                  • bool
                                  • -
                                  • const
                                  • -
                                  • concept
                                  • +
                                  • protected
                                  • +
                                  • public
                                  • +
                                  • register
                                  • +
                                  • reinterpret_cast
                                  • +
                                  • requires
                                  • +
                                  • return
                                  • +
                                  • short
                                  • +
                                  • signed
                                  • +
                                  • sizeof
                                  • +
                                  • static
                                  • static_assert
                                  • -
                                  • for
                                  • -
                                  • delete
                                  • -
                                  • long
                                  • +
                                  • static_cast
                                  • +
                                  • struct
                                  • switch
                                  • -
                                  • default
                                  • -
                                  • not
                                  • -
                                  • goto
                                  • -
                                  • public
                                  • -
                                  • and
                                  • -
                                  • and_eq
                                  • -
                                  • linux
                                  • -
                                  • or_eq
                                  • -
                                  • xor
                                  • -
                                  • class
                                  • -
                                  • wchar_t
                                  • -
                                  • alignof
                                  • -
                                  • or
                                  • -
                                  • break
                                  • -
                                  • false
                                  • +
                                  • template
                                  • +
                                  • this
                                  • thread_local
                                  • -
                                  • char32_t
                                  • -
                                  • volatile
                                  • -
                                  • union
                                  • -
                                  • int
                                  • -
                                  • inline
                                  • throw
                                  • -
                                  • char
                                  • -
                                  • namespace
                                  • -
                                  • short
                                  • -
                                  • unsigned
                                  • -
                                  • asm
                                  • -
                                  • return
                                  • +
                                  • true
                                  • +
                                  • try
                                  • +
                                  • typedef
                                  • +
                                  • typeid
                                  • typename
                                  • -
                                  • register
                                  • +
                                  • union
                                  • +
                                  • unsigned
                                  • +
                                  • using
                                  • +
                                  • virtual
                                  • +
                                  • void
                                  • +
                                  • volatile
                                  • +
                                  • wchar_t
                                  • +
                                  • while
                                  • +
                                  • xor
                                  • +
                                  • xor_eq
                                  diff --git a/docs/generators/cpp-qt5-qhttpengine-server.md b/docs/generators/cpp-qt5-qhttpengine-server.md index b2fd9b353845..4d9518c2bea4 100644 --- a/docs/generators/cpp-qt5-qhttpengine-server.md +++ b/docs/generators/cpp-qt5-qhttpengine-server.md @@ -5,13 +5,14 @@ sidebar_label: cpp-qt5-qhttpengine-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|contentCompression|Enable Compressed Content Encoding for requests and responses| |false| |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| +|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| ## IMPORT MAPPING @@ -28,104 +29,104 @@ sidebar_label: cpp-qt5-qhttpengine-server ## LANGUAGE PRIMITIVES -
                                  • QDateTime
                                  • +
                                    • QByteArray
                                    • +
                                    • QDate
                                    • +
                                    • QDateTime
                                    • QString
                                    • -
                                    • qint64
                                    • -
                                    • qint32
                                    • bool
                                    • -
                                    • QByteArray
                                    • double
                                    • -
                                    • QDate
                                    • float
                                    • +
                                    • qint32
                                    • +
                                    • qint64
                                    ## RESERVED WORDS -
                                    • struct
                                    • +
                                      • alignas
                                      • +
                                      • alignof
                                      • +
                                      • and
                                      • +
                                      • and_eq
                                      • +
                                      • asm
                                      • auto
                                      • -
                                      • xor_eq
                                      • +
                                      • bitand
                                      • +
                                      • bitor
                                      • +
                                      • bool
                                      • +
                                      • break
                                      • +
                                      • case
                                      • +
                                      • catch
                                      • +
                                      • char
                                      • +
                                      • char16_t
                                      • +
                                      • char32_t
                                      • +
                                      • class
                                      • +
                                      • compl
                                      • +
                                      • concept
                                      • +
                                      • const
                                      • const_cast
                                      • -
                                      • decltype
                                      • -
                                      • alignas
                                      • -
                                      • extern
                                      • -
                                      • do
                                      • -
                                      • float
                                      • -
                                      • while
                                      • constexpr
                                      • -
                                      • operator
                                      • -
                                      • bitand
                                      • -
                                      • protected
                                      • continue
                                      • +
                                      • decltype
                                      • +
                                      • default
                                      • +
                                      • delete
                                      • +
                                      • do
                                      • +
                                      • double
                                      • +
                                      • dynamic_cast
                                      • else
                                      • -
                                      • friend
                                      • -
                                      • mutable
                                      • -
                                      • compl
                                      • -
                                      • typeid
                                      • -
                                      • catch
                                      • +
                                      • enum
                                      • +
                                      • explicit
                                      • export
                                      • +
                                      • extern
                                      • +
                                      • false
                                      • +
                                      • float
                                      • +
                                      • for
                                      • +
                                      • friend
                                      • +
                                      • goto
                                      • if
                                      • -
                                      • case
                                      • -
                                      • dynamic_cast
                                      • -
                                      • not_eq
                                      • +
                                      • inline
                                      • +
                                      • int
                                      • +
                                      • linux
                                      • +
                                      • long
                                      • +
                                      • mutable
                                      • +
                                      • namespace
                                      • new
                                      • -
                                      • using
                                      • -
                                      • static
                                      • -
                                      • void
                                      • -
                                      • sizeof
                                      • -
                                      • bitor
                                      • -
                                      • double
                                      • -
                                      • this
                                      • -
                                      • signed
                                      • noexcept
                                      • -
                                      • typedef
                                      • -
                                      • enum
                                      • -
                                      • char16_t
                                      • -
                                      • explicit
                                      • -
                                      • static_cast
                                      • -
                                      • true
                                      • -
                                      • try
                                      • -
                                      • reinterpret_cast
                                      • +
                                      • not
                                      • +
                                      • not_eq
                                      • nullptr
                                      • -
                                      • requires
                                      • -
                                      • template
                                      • +
                                      • operator
                                      • +
                                      • or
                                      • +
                                      • or_eq
                                      • private
                                      • -
                                      • virtual
                                      • -
                                      • bool
                                      • -
                                      • const
                                      • -
                                      • concept
                                      • +
                                      • protected
                                      • +
                                      • public
                                      • +
                                      • register
                                      • +
                                      • reinterpret_cast
                                      • +
                                      • requires
                                      • +
                                      • return
                                      • +
                                      • short
                                      • +
                                      • signed
                                      • +
                                      • sizeof
                                      • +
                                      • static
                                      • static_assert
                                      • -
                                      • for
                                      • -
                                      • delete
                                      • -
                                      • long
                                      • +
                                      • static_cast
                                      • +
                                      • struct
                                      • switch
                                      • -
                                      • default
                                      • -
                                      • not
                                      • -
                                      • goto
                                      • -
                                      • public
                                      • -
                                      • and
                                      • -
                                      • and_eq
                                      • -
                                      • linux
                                      • -
                                      • or_eq
                                      • -
                                      • xor
                                      • -
                                      • class
                                      • -
                                      • wchar_t
                                      • -
                                      • alignof
                                      • -
                                      • or
                                      • -
                                      • break
                                      • -
                                      • false
                                      • +
                                      • template
                                      • +
                                      • this
                                      • thread_local
                                      • -
                                      • char32_t
                                      • -
                                      • volatile
                                      • -
                                      • union
                                      • -
                                      • int
                                      • -
                                      • inline
                                      • throw
                                      • -
                                      • char
                                      • -
                                      • namespace
                                      • -
                                      • short
                                      • -
                                      • unsigned
                                      • -
                                      • asm
                                      • -
                                      • return
                                      • +
                                      • true
                                      • +
                                      • try
                                      • +
                                      • typedef
                                      • +
                                      • typeid
                                      • typename
                                      • -
                                      • register
                                      • +
                                      • union
                                      • +
                                      • unsigned
                                      • +
                                      • using
                                      • +
                                      • virtual
                                      • +
                                      • void
                                      • +
                                      • volatile
                                      • +
                                      • wchar_t
                                      • +
                                      • while
                                      • +
                                      • xor
                                      • +
                                      • xor_eq
                                      diff --git a/docs/generators/cpp-restbed-server.md b/docs/generators/cpp-restbed-server.md index cab905d9b54a..4c59be6e67a2 100644 --- a/docs/generators/cpp-restbed-server.md +++ b/docs/generators/cpp-restbed-server.md @@ -5,21 +5,21 @@ sidebar_label: cpp-restbed-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.server.model| |apiPackage|C++ namespace for apis (convention: name.space.api).| |org.openapitools.server.api| -|packageVersion|C++ package version.| |1.0.0| |declspec|C++ preprocessor to place before the class name for handling dllexport/dllimport.| || |defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include "Commons.h" | || +|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.server.model| +|packageVersion|C++ package version.| |1.0.0| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|std::vector|#include <vector>| -|std::map|#include <map>| -|std::string|#include <string>| |Object|#include "Object.h"| |restbed::Bytes|#include <corvusoft/restbed/byte.hpp>| +|std::map|#include <map>| +|std::string|#include <string>| +|std::vector|#include <vector>| ## INSTANTIATION TYPES @@ -31,102 +31,102 @@ sidebar_label: cpp-restbed-server ## LANGUAGE PRIMITIVES
                                      • bool
                                      • -
                                      • double
                                      • char
                                      • +
                                      • double
                                      • float
                                      • -
                                      • int64_t
                                      • int
                                      • -
                                      • long
                                      • int32_t
                                      • +
                                      • int64_t
                                      • +
                                      • long
                                      ## RESERVED WORDS -
                                      • struct
                                      • +
                                        • alignas
                                        • +
                                        • alignof
                                        • +
                                        • and
                                        • +
                                        • and_eq
                                        • +
                                        • asm
                                        • auto
                                        • -
                                        • xor_eq
                                        • +
                                        • bitand
                                        • +
                                        • bitor
                                        • +
                                        • bool
                                        • +
                                        • break
                                        • +
                                        • case
                                        • +
                                        • catch
                                        • +
                                        • char
                                        • +
                                        • char16_t
                                        • +
                                        • char32_t
                                        • +
                                        • class
                                        • +
                                        • compl
                                        • +
                                        • concept
                                        • +
                                        • const
                                        • const_cast
                                        • -
                                        • decltype
                                        • -
                                        • alignas
                                        • -
                                        • extern
                                        • -
                                        • do
                                        • -
                                        • float
                                        • -
                                        • while
                                        • constexpr
                                        • -
                                        • operator
                                        • -
                                        • bitand
                                        • -
                                        • protected
                                        • continue
                                        • +
                                        • decltype
                                        • +
                                        • default
                                        • +
                                        • delete
                                        • +
                                        • do
                                        • +
                                        • double
                                        • +
                                        • dynamic_cast
                                        • else
                                        • -
                                        • friend
                                        • -
                                        • mutable
                                        • -
                                        • compl
                                        • -
                                        • typeid
                                        • -
                                        • catch
                                        • +
                                        • enum
                                        • +
                                        • explicit
                                        • export
                                        • +
                                        • extern
                                        • +
                                        • false
                                        • +
                                        • float
                                        • +
                                        • for
                                        • +
                                        • friend
                                        • +
                                        • goto
                                        • if
                                        • -
                                        • case
                                        • -
                                        • dynamic_cast
                                        • -
                                        • not_eq
                                        • +
                                        • inline
                                        • +
                                        • int
                                        • +
                                        • linux
                                        • +
                                        • long
                                        • +
                                        • mutable
                                        • +
                                        • namespace
                                        • new
                                        • -
                                        • using
                                        • -
                                        • static
                                        • -
                                        • void
                                        • -
                                        • sizeof
                                        • -
                                        • bitor
                                        • -
                                        • double
                                        • -
                                        • this
                                        • -
                                        • signed
                                        • noexcept
                                        • -
                                        • typedef
                                        • -
                                        • enum
                                        • -
                                        • char16_t
                                        • -
                                        • explicit
                                        • -
                                        • static_cast
                                        • -
                                        • true
                                        • -
                                        • try
                                        • -
                                        • reinterpret_cast
                                        • +
                                        • not
                                        • +
                                        • not_eq
                                        • nullptr
                                        • -
                                        • requires
                                        • -
                                        • template
                                        • +
                                        • operator
                                        • +
                                        • or
                                        • +
                                        • or_eq
                                        • private
                                        • -
                                        • virtual
                                        • -
                                        • bool
                                        • -
                                        • const
                                        • -
                                        • concept
                                        • +
                                        • protected
                                        • +
                                        • public
                                        • +
                                        • register
                                        • +
                                        • reinterpret_cast
                                        • +
                                        • requires
                                        • +
                                        • return
                                        • +
                                        • short
                                        • +
                                        • signed
                                        • +
                                        • sizeof
                                        • +
                                        • static
                                        • static_assert
                                        • -
                                        • for
                                        • -
                                        • delete
                                        • -
                                        • long
                                        • +
                                        • static_cast
                                        • +
                                        • struct
                                        • switch
                                        • -
                                        • default
                                        • -
                                        • not
                                        • -
                                        • goto
                                        • -
                                        • public
                                        • -
                                        • and
                                        • -
                                        • and_eq
                                        • -
                                        • linux
                                        • -
                                        • or_eq
                                        • -
                                        • xor
                                        • -
                                        • class
                                        • -
                                        • wchar_t
                                        • -
                                        • alignof
                                        • -
                                        • or
                                        • -
                                        • break
                                        • -
                                        • false
                                        • +
                                        • template
                                        • +
                                        • this
                                        • thread_local
                                        • -
                                        • char32_t
                                        • -
                                        • volatile
                                        • -
                                        • union
                                        • -
                                        • int
                                        • -
                                        • inline
                                        • throw
                                        • -
                                        • char
                                        • -
                                        • namespace
                                        • -
                                        • short
                                        • -
                                        • unsigned
                                        • -
                                        • asm
                                        • -
                                        • return
                                        • +
                                        • true
                                        • +
                                        • try
                                        • +
                                        • typedef
                                        • +
                                        • typeid
                                        • typename
                                        • -
                                        • register
                                        • +
                                        • union
                                        • +
                                        • unsigned
                                        • +
                                        • using
                                        • +
                                        • virtual
                                        • +
                                        • void
                                        • +
                                        • volatile
                                        • +
                                        • wchar_t
                                        • +
                                        • while
                                        • +
                                        • xor
                                        • +
                                        • xor_eq
                                        diff --git a/docs/generators/cpp-restsdk.md b/docs/generators/cpp-restsdk.md index 289a67fa7eec..6bf209af7964 100644 --- a/docs/generators/cpp-restsdk.md +++ b/docs/generators/cpp-restsdk.md @@ -5,24 +5,24 @@ sidebar_label: cpp-restsdk | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.client.model| |apiPackage|C++ namespace for apis (convention: name.space.api).| |org.openapitools.client.api| -|packageVersion|C++ package version.| |1.0.0| |declspec|C++ preprocessor to place before the class name for handling dllexport/dllimport.| || |defaultInclude|The default include statement that should be placed in all headers for including things like the declspec (convention: #include "Commons.h" | || |generateGMocksForApis|Generate Google Mock classes for APIs.| |null| +|modelPackage|C++ namespace for models (convention: name.space.model).| |org.openapitools.client.model| +|packageVersion|C++ package version.| |1.0.0| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|std::vector|#include <vector>| -|utility::string_t|#include <cpprest/details/basic_types.h>| +|HttpContent|#include "HttpContent.h"| +|Object|#include "Object.h"| |std::map|#include <map>| |std::string|#include <string>| +|std::vector|#include <vector>| |utility::datetime|#include <cpprest/details/basic_types.h>| -|Object|#include "Object.h"| -|HttpContent|#include "HttpContent.h"| +|utility::string_t|#include <cpprest/details/basic_types.h>| ## INSTANTIATION TYPES @@ -34,102 +34,102 @@ sidebar_label: cpp-restsdk ## LANGUAGE PRIMITIVES
                                        • bool
                                        • -
                                        • double
                                        • char
                                        • +
                                        • double
                                        • float
                                        • -
                                        • int64_t
                                        • int
                                        • -
                                        • long
                                        • int32_t
                                        • +
                                        • int64_t
                                        • +
                                        • long
                                        ## RESERVED WORDS -
                                        • struct
                                        • +
                                          • alignas
                                          • +
                                          • alignof
                                          • +
                                          • and
                                          • +
                                          • and_eq
                                          • +
                                          • asm
                                          • auto
                                          • -
                                          • xor_eq
                                          • +
                                          • bitand
                                          • +
                                          • bitor
                                          • +
                                          • bool
                                          • +
                                          • break
                                          • +
                                          • case
                                          • +
                                          • catch
                                          • +
                                          • char
                                          • +
                                          • char16_t
                                          • +
                                          • char32_t
                                          • +
                                          • class
                                          • +
                                          • compl
                                          • +
                                          • concept
                                          • +
                                          • const
                                          • const_cast
                                          • -
                                          • decltype
                                          • -
                                          • alignas
                                          • -
                                          • extern
                                          • -
                                          • do
                                          • -
                                          • float
                                          • -
                                          • while
                                          • constexpr
                                          • -
                                          • operator
                                          • -
                                          • bitand
                                          • -
                                          • protected
                                          • continue
                                          • +
                                          • decltype
                                          • +
                                          • default
                                          • +
                                          • delete
                                          • +
                                          • do
                                          • +
                                          • double
                                          • +
                                          • dynamic_cast
                                          • else
                                          • -
                                          • friend
                                          • -
                                          • mutable
                                          • -
                                          • compl
                                          • -
                                          • typeid
                                          • -
                                          • catch
                                          • +
                                          • enum
                                          • +
                                          • explicit
                                          • export
                                          • +
                                          • extern
                                          • +
                                          • false
                                          • +
                                          • float
                                          • +
                                          • for
                                          • +
                                          • friend
                                          • +
                                          • goto
                                          • if
                                          • -
                                          • case
                                          • -
                                          • dynamic_cast
                                          • -
                                          • not_eq
                                          • +
                                          • inline
                                          • +
                                          • int
                                          • +
                                          • linux
                                          • +
                                          • long
                                          • +
                                          • mutable
                                          • +
                                          • namespace
                                          • new
                                          • -
                                          • using
                                          • -
                                          • static
                                          • -
                                          • void
                                          • -
                                          • sizeof
                                          • -
                                          • bitor
                                          • -
                                          • double
                                          • -
                                          • this
                                          • -
                                          • signed
                                          • noexcept
                                          • -
                                          • typedef
                                          • -
                                          • enum
                                          • -
                                          • char16_t
                                          • -
                                          • explicit
                                          • -
                                          • static_cast
                                          • -
                                          • true
                                          • -
                                          • try
                                          • -
                                          • reinterpret_cast
                                          • +
                                          • not
                                          • +
                                          • not_eq
                                          • nullptr
                                          • -
                                          • requires
                                          • -
                                          • template
                                          • +
                                          • operator
                                          • +
                                          • or
                                          • +
                                          • or_eq
                                          • private
                                          • -
                                          • virtual
                                          • -
                                          • bool
                                          • -
                                          • const
                                          • -
                                          • concept
                                          • +
                                          • protected
                                          • +
                                          • public
                                          • +
                                          • register
                                          • +
                                          • reinterpret_cast
                                          • +
                                          • requires
                                          • +
                                          • return
                                          • +
                                          • short
                                          • +
                                          • signed
                                          • +
                                          • sizeof
                                          • +
                                          • static
                                          • static_assert
                                          • -
                                          • for
                                          • -
                                          • delete
                                          • -
                                          • long
                                          • +
                                          • static_cast
                                          • +
                                          • struct
                                          • switch
                                          • -
                                          • default
                                          • -
                                          • not
                                          • -
                                          • goto
                                          • -
                                          • public
                                          • -
                                          • and
                                          • -
                                          • and_eq
                                          • -
                                          • linux
                                          • -
                                          • or_eq
                                          • -
                                          • xor
                                          • -
                                          • class
                                          • -
                                          • wchar_t
                                          • -
                                          • alignof
                                          • -
                                          • or
                                          • -
                                          • break
                                          • -
                                          • false
                                          • +
                                          • template
                                          • +
                                          • this
                                          • thread_local
                                          • -
                                          • char32_t
                                          • -
                                          • volatile
                                          • -
                                          • union
                                          • -
                                          • int
                                          • -
                                          • inline
                                          • throw
                                          • -
                                          • char
                                          • -
                                          • namespace
                                          • -
                                          • short
                                          • -
                                          • unsigned
                                          • -
                                          • asm
                                          • -
                                          • return
                                          • +
                                          • true
                                          • +
                                          • try
                                          • +
                                          • typedef
                                          • +
                                          • typeid
                                          • typename
                                          • -
                                          • register
                                          • +
                                          • union
                                          • +
                                          • unsigned
                                          • +
                                          • using
                                          • +
                                          • virtual
                                          • +
                                          • void
                                          • +
                                          • volatile
                                          • +
                                          • wchar_t
                                          • +
                                          • while
                                          • +
                                          • xor
                                          • +
                                          • xor_eq
                                          diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index c9d3d3b80a1d..4cabf3db4431 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -5,11 +5,11 @@ sidebar_label: cpp-tizen | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| ## IMPORT MAPPING @@ -26,105 +26,105 @@ sidebar_label: cpp-tizen ## LANGUAGE PRIMITIVES
                                          • bool
                                          • -
                                          • std::string
                                          • double
                                          • -
                                          • long long
                                          • float
                                          • int
                                          • +
                                          • long long
                                          • +
                                          • std::string
                                          ## RESERVED WORDS -
                                          • struct
                                          • -
                                          • synchronized
                                          • +
                                            • alignas
                                            • +
                                            • alignof
                                            • +
                                            • and
                                            • +
                                            • and_eq
                                            • +
                                            • asm
                                            • +
                                            • atomic_cancel
                                            • +
                                            • atomic_commit
                                            • +
                                            • atomic_noexcept
                                            • auto
                                            • -
                                            • xor_eq
                                            • +
                                            • bitand
                                            • +
                                            • bitor
                                            • +
                                            • bool
                                            • +
                                            • break
                                            • +
                                            • case
                                            • +
                                            • catch
                                            • +
                                            • char
                                            • +
                                            • char16_t
                                            • +
                                            • char32_t
                                            • +
                                            • class
                                            • +
                                            • compl
                                            • +
                                            • concept
                                            • +
                                            • const
                                            • const_cast
                                            • -
                                            • decltype
                                            • -
                                            • alignas
                                            • -
                                            • extern
                                            • -
                                            • do
                                            • -
                                            • float
                                            • -
                                            • while
                                            • constexpr
                                            • -
                                            • operator
                                            • -
                                            • bitand
                                            • -
                                            • protected
                                            • continue
                                            • +
                                            • decltype
                                            • +
                                            • default
                                            • +
                                            • delete
                                            • +
                                            • do
                                            • +
                                            • double
                                            • +
                                            • dynamic_cast
                                            • else
                                            • -
                                            • friend
                                            • -
                                            • mutable
                                            • -
                                            • compl
                                            • -
                                            • typeid
                                            • -
                                            • catch
                                            • +
                                            • enum
                                            • +
                                            • explicit
                                            • export
                                            • +
                                            • extern
                                            • +
                                            • false
                                            • +
                                            • float
                                            • +
                                            • for
                                            • +
                                            • friend
                                            • +
                                            • goto
                                            • if
                                            • -
                                            • case
                                            • -
                                            • dynamic_cast
                                            • -
                                            • not_eq
                                            • -
                                            • new
                                            • -
                                            • using
                                            • -
                                            • atomic_commit
                                            • -
                                            • static
                                            • -
                                            • void
                                            • -
                                            • sizeof
                                            • -
                                            • bitor
                                            • -
                                            • double
                                            • +
                                            • import
                                            • +
                                            • inline
                                            • +
                                            • int
                                            • +
                                            • long
                                            • module
                                            • -
                                            • this
                                            • -
                                            • signed
                                            • -
                                            • atomic_cancel
                                            • +
                                            • mutable
                                            • +
                                            • namespace
                                            • +
                                            • new
                                            • noexcept
                                            • -
                                            • typedef
                                            • -
                                            • enum
                                            • -
                                            • char16_t
                                            • -
                                            • explicit
                                            • -
                                            • static_cast
                                            • -
                                            • true
                                            • -
                                            • try
                                            • -
                                            • reinterpret_cast
                                            • +
                                            • not
                                            • +
                                            • not_eq
                                            • nullptr
                                            • -
                                            • requires
                                            • -
                                            • template
                                            • +
                                            • operator
                                            • +
                                            • or
                                            • +
                                            • or_eq
                                            • private
                                            • -
                                            • virtual
                                            • -
                                            • bool
                                            • -
                                            • const
                                            • -
                                            • import
                                            • -
                                            • concept
                                            • +
                                            • protected
                                            • +
                                            • public
                                            • +
                                            • register
                                            • +
                                            • reinterpret_cast
                                            • +
                                            • requires
                                            • +
                                            • return
                                            • +
                                            • short
                                            • +
                                            • signed
                                            • +
                                            • sizeof
                                            • +
                                            • static
                                            • static_assert
                                            • -
                                            • for
                                            • -
                                            • atomic_noexcept
                                            • -
                                            • delete
                                            • -
                                            • long
                                            • +
                                            • static_cast
                                            • +
                                            • struct
                                            • switch
                                            • -
                                            • default
                                            • -
                                            • not
                                            • -
                                            • goto
                                            • -
                                            • public
                                            • -
                                            • and
                                            • -
                                            • and_eq
                                            • -
                                            • or_eq
                                            • -
                                            • xor
                                            • -
                                            • class
                                            • -
                                            • wchar_t
                                            • -
                                            • alignof
                                            • -
                                            • or
                                            • -
                                            • break
                                            • -
                                            • false
                                            • +
                                            • synchronized
                                            • +
                                            • template
                                            • +
                                            • this
                                            • thread_local
                                            • -
                                            • char32_t
                                            • -
                                            • volatile
                                            • -
                                            • union
                                            • -
                                            • int
                                            • -
                                            • inline
                                            • throw
                                            • -
                                            • char
                                            • -
                                            • namespace
                                            • -
                                            • short
                                            • -
                                            • unsigned
                                            • -
                                            • asm
                                            • -
                                            • return
                                            • +
                                            • true
                                            • +
                                            • try
                                            • +
                                            • typedef
                                            • +
                                            • typeid
                                            • typename
                                            • -
                                            • register
                                            • +
                                            • union
                                            • +
                                            • unsigned
                                            • +
                                            • using
                                            • +
                                            • virtual
                                            • +
                                            • void
                                            • +
                                            • volatile
                                            • +
                                            • wchar_t
                                            • +
                                            • while
                                            • +
                                            • xor
                                            • +
                                            • xor_eq
                                            diff --git a/docs/generators/csharp-dotnet2.md b/docs/generators/csharp-dotnet2.md index 864b3a8476b4..adf5841d42f3 100644 --- a/docs/generators/csharp-dotnet2.md +++ b/docs/generators/csharp-dotnet2.md @@ -5,9 +5,9 @@ sidebar_label: csharp-dotnet2 | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|clientPackage|C# client package name (convention: Camel.Case).| |Org.OpenAPITools.Client| |packageName|C# package name (convention: Camel.Case).| |Org.OpenAPITools| |packageVersion|C# package version.| |1.0.0| -|clientPackage|C# client package name (convention: Camel.Case).| |Org.OpenAPITools.Client| ## IMPORT MAPPING @@ -26,133 +26,133 @@ sidebar_label: csharp-dotnet2 ## LANGUAGE PRIMITIVES -
                                            • int?
                                            • -
                                            • Dictionary
                                            • -
                                            • string
                                            • -
                                            • bool
                                            • -
                                            • DateTimeOffset?
                                            • -
                                            • String
                                            • -
                                            • Guid
                                            • -
                                            • System.IO.Stream
                                            • -
                                            • bool?
                                            • -
                                            • float
                                            • -
                                            • long
                                            • +
                                              • Boolean
                                              • +
                                              • Collection
                                              • DateTime
                                              • -
                                              • Int32
                                              • -
                                              • float?
                                              • DateTime?
                                              • -
                                              • List
                                              • -
                                              • Boolean
                                              • -
                                              • long?
                                              • -
                                              • double
                                              • -
                                              • Guid?
                                              • DateTimeOffset
                                              • +
                                              • DateTimeOffset?
                                              • +
                                              • Dictionary
                                              • Double
                                              • -
                                              • int
                                              • -
                                              • byte[]
                                              • Float
                                              • -
                                              • Int64
                                              • -
                                              • double?
                                              • +
                                              • Guid
                                              • +
                                              • Guid?
                                              • ICollection
                                              • -
                                              • Collection
                                              • +
                                              • Int32
                                              • +
                                              • Int64
                                              • +
                                              • List
                                              • Object
                                              • -
                                              • decimal?
                                              • +
                                              • String
                                              • +
                                              • System.IO.Stream
                                              • +
                                              • bool
                                              • +
                                              • bool?
                                              • +
                                              • byte[]
                                              • decimal
                                              • +
                                              • decimal?
                                              • +
                                              • double
                                              • +
                                              • double?
                                              • +
                                              • float
                                              • +
                                              • float?
                                              • +
                                              • int
                                              • +
                                              • int?
                                              • +
                                              • long
                                              • +
                                              • long?
                                              • +
                                              • string
                                              ## RESERVED WORDS -
                                              • struct
                                              • -
                                              • extern
                                              • -
                                              • do
                                              • -
                                              • ushort
                                              • -
                                              • float
                                              • -
                                              • while
                                              • -
                                              • operator
                                              • -
                                              • localVarQueryParams
                                              • -
                                              • ref
                                              • -
                                              • protected
                                              • -
                                              • readonly
                                              • -
                                              • continue
                                              • -
                                              • else
                                              • -
                                              • checked
                                              • -
                                              • lock
                                              • -
                                              • localVarPathParams
                                              • -
                                              • catch
                                              • -
                                              • Client
                                              • -
                                              • if
                                              • -
                                              • case
                                              • -
                                              • localVarHttpHeaderAccepts
                                              • -
                                              • new
                                              • -
                                              • using
                                              • -
                                              • static
                                              • -
                                              • void
                                              • -
                                              • localVarPostBody
                                              • -
                                              • in
                                              • -
                                              • sizeof
                                              • -
                                              • localVarResponse
                                              • +
                                                • Client
                                                • +
                                                • abstract
                                                • +
                                                • as
                                                • +
                                                • base
                                                • +
                                                • bool
                                                • +
                                                • break
                                                • byte
                                                • +
                                                • case
                                                • +
                                                • catch
                                                • +
                                                • char
                                                • +
                                                • checked
                                                • +
                                                • class
                                                • +
                                                • client
                                                • +
                                                • const
                                                • +
                                                • continue
                                                • +
                                                • decimal
                                                • +
                                                • default
                                                • +
                                                • delegate
                                                • +
                                                • do
                                                • double
                                                • -
                                                • sealed
                                                • -
                                                • finally
                                                • -
                                                • this
                                                • -
                                                • unchecked
                                                • -
                                                • is
                                                • -
                                                • params
                                                • +
                                                • else
                                                • enum
                                                • +
                                                • event
                                                • explicit
                                                • -
                                                • as
                                                • -
                                                • null
                                                • -
                                                • localVarPath
                                                • -
                                                • true
                                                • +
                                                • extern
                                                • +
                                                • false
                                                • +
                                                • finally
                                                • fixed
                                                • -
                                                • try
                                                • -
                                                • decimal
                                                • -
                                                • object
                                                • +
                                                • float
                                                • +
                                                • for
                                                • +
                                                • foreach
                                                • +
                                                • goto
                                                • +
                                                • if
                                                • implicit
                                                • +
                                                • in
                                                • +
                                                • int
                                                • +
                                                • interface
                                                • internal
                                                • -
                                                • private
                                                • -
                                                • virtual
                                                • -
                                                • bool
                                                • -
                                                • const
                                                • -
                                                • string
                                                • -
                                                • for
                                                • +
                                                • is
                                                • +
                                                • localVarFileParams
                                                • +
                                                • localVarFormParams
                                                • +
                                                • localVarHeaderParams
                                                • +
                                                • localVarHttpContentType
                                                • +
                                                • localVarHttpContentTypes
                                                • localVarHttpHeaderAccept
                                                • -
                                                • interface
                                                • -
                                                • unsafe
                                                • +
                                                • localVarHttpHeaderAccepts
                                                • +
                                                • localVarPath
                                                • +
                                                • localVarPathParams
                                                • +
                                                • localVarPostBody
                                                • +
                                                • localVarQueryParams
                                                • +
                                                • localVarResponse
                                                • +
                                                • localVarStatusCode
                                                • +
                                                • lock
                                                • long
                                                • +
                                                • namespace
                                                • +
                                                • new
                                                • +
                                                • null
                                                • +
                                                • object
                                                • +
                                                • operator
                                                • out
                                                • -
                                                • switch
                                                • -
                                                • delegate
                                                • -
                                                • foreach
                                                • -
                                                • default
                                                • -
                                                • ulong
                                                • -
                                                • goto
                                                • -
                                                • localVarHttpContentTypes
                                                • -
                                                • localVarHttpContentType
                                                • +
                                                • override
                                                • +
                                                • parameter
                                                • +
                                                • params
                                                • +
                                                • private
                                                • +
                                                • protected
                                                • public
                                                • -
                                                • localVarStatusCode
                                                • +
                                                • readonly
                                                • +
                                                • ref
                                                • +
                                                • return
                                                • +
                                                • sbyte
                                                • +
                                                • sealed
                                                • +
                                                • short
                                                • +
                                                • sizeof
                                                • stackalloc
                                                • -
                                                • parameter
                                                • -
                                                • client
                                                • -
                                                • override
                                                • -
                                                • event
                                                • -
                                                • class
                                                • +
                                                • static
                                                • +
                                                • string
                                                • +
                                                • struct
                                                • +
                                                • switch
                                                • +
                                                • this
                                                • +
                                                • throw
                                                • +
                                                • true
                                                • +
                                                • try
                                                • typeof
                                                • -
                                                • localVarFormParams
                                                • -
                                                • break
                                                • -
                                                • false
                                                • -
                                                • volatile
                                                • -
                                                • abstract
                                                • uint
                                                • -
                                                • int
                                                • -
                                                • localVarHeaderParams
                                                • -
                                                • throw
                                                • -
                                                • char
                                                • -
                                                • namespace
                                                • -
                                                • sbyte
                                                • -
                                                • short
                                                • -
                                                • localVarFileParams
                                                • -
                                                • return
                                                • -
                                                • base
                                                • +
                                                • ulong
                                                • +
                                                • unchecked
                                                • +
                                                • unsafe
                                                • +
                                                • ushort
                                                • +
                                                • using
                                                • +
                                                • virtual
                                                • +
                                                • void
                                                • +
                                                • volatile
                                                • +
                                                • while
                                                diff --git a/docs/generators/csharp-nancyfx.md b/docs/generators/csharp-nancyfx.md index 20d46765b497..48913347f599 100644 --- a/docs/generators/csharp-nancyfx.md +++ b/docs/generators/csharp-nancyfx.md @@ -5,20 +5,20 @@ sidebar_label: csharp-nancyfx | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| -|packageVersion|C# package version.| |1.0.0| -|sourceFolder|source folder for generated code| |src| +|asyncServer|Set to true to enable the generation of async routes/endpoints.| |false| +|immutable|Enabled by default. If disabled generates model classes with setters| |true| |interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| || -|packageGuid|The GUID that will be associated with the C# project| |null| +|optionalProjectFile|Generate {PackageName}.csproj.| |true| |packageContext|Optionally overrides the PackageContext which determines the namespace (namespace=packageName.packageContext). If not set, packageContext will default to basePath.| |null| +|packageGuid|The GUID that will be associated with the C# project| |null| +|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| +|packageVersion|C# package version.| |1.0.0| +|returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|optionalProjectFile|Generate {PackageName}.csproj.| |true| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| +|sourceFolder|source folder for generated code| |src| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|immutable|Enabled by default. If disabled generates model classes with setters| |true| +|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |writeModulePath|Enabled by default. If disabled, module paths will not mirror api base path| |true| -|asyncServer|Set to true to enable the generation of async routes/endpoints.| |false| ## IMPORT MAPPING @@ -37,48 +37,48 @@ sidebar_label: csharp-nancyfx ## LANGUAGE PRIMITIVES -
                                                • int?
                                                • -
                                                • Dictionary
                                                • -
                                                • string
                                                • -
                                                • bool
                                                • -
                                                • LocalDate?
                                                • -
                                                • DateTimeOffset?
                                                • -
                                                • ZonedDateTime?
                                                • -
                                                • String
                                                • -
                                                • Guid
                                                • -
                                                • System.IO.Stream
                                                • -
                                                • bool?
                                                • -
                                                • float
                                                • -
                                                • long
                                                • +
                                                  • Boolean
                                                  • +
                                                  • Collection
                                                  • DateTime
                                                  • -
                                                  • Int32
                                                  • -
                                                  • float?
                                                  • DateTime?
                                                  • -
                                                  • List
                                                  • -
                                                  • Boolean
                                                  • -
                                                  • LocalTime?
                                                  • -
                                                  • long?
                                                  • -
                                                  • double
                                                  • -
                                                  • Guid?
                                                  • DateTimeOffset
                                                  • +
                                                  • DateTimeOffset?
                                                  • +
                                                  • Dictionary
                                                  • Double
                                                  • -
                                                  • int
                                                  • -
                                                  • byte[]
                                                  • Float
                                                  • -
                                                  • Int64
                                                  • -
                                                  • double?
                                                  • +
                                                  • Guid
                                                  • +
                                                  • Guid?
                                                  • ICollection
                                                  • -
                                                  • Collection
                                                  • +
                                                  • Int32
                                                  • +
                                                  • Int64
                                                  • +
                                                  • List
                                                  • +
                                                  • LocalDate?
                                                  • +
                                                  • LocalTime?
                                                  • Object
                                                  • -
                                                  • decimal?
                                                  • +
                                                  • String
                                                  • +
                                                  • System.IO.Stream
                                                  • +
                                                  • ZonedDateTime?
                                                  • +
                                                  • bool
                                                  • +
                                                  • bool?
                                                  • +
                                                  • byte[]
                                                  • decimal
                                                  • +
                                                  • decimal?
                                                  • +
                                                  • double
                                                  • +
                                                  • double?
                                                  • +
                                                  • float
                                                  • +
                                                  • float?
                                                  • +
                                                  • int
                                                  • +
                                                  • int?
                                                  • +
                                                  • long
                                                  • +
                                                  • long?
                                                  • +
                                                  • string
                                                  ## RESERVED WORDS
                                                  • async
                                                  • -
                                                  • var
                                                  • -
                                                  • yield
                                                  • await
                                                  • dynamic
                                                  • +
                                                  • var
                                                  • +
                                                  • yield
                                                  diff --git a/docs/generators/csharp-netcore.md b/docs/generators/csharp-netcore.md index 167c20065061..7b67601f3d3c 100644 --- a/docs/generators/csharp-netcore.md +++ b/docs/generators/csharp-netcore.md @@ -5,27 +5,30 @@ sidebar_label: csharp-netcore | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| -|packageVersion|C# package version.| |1.0.0| -|sourceFolder|source folder for generated code| |src| -|packageGuid|The GUID that will be associated with the C# project| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| -|targetFramework|The target .NET framework version.|
                                                  **netstandard1.3**
                                                  .NET Standard 1.3 compatible
                                                  **netstandard1.4**
                                                  .NET Standard 1.4 compatible
                                                  **netstandard1.5**
                                                  .NET Standard 1.5 compatible
                                                  **netstandard1.6**
                                                  .NET Standard 1.6 compatible
                                                  **netstandard2.0**
                                                  .NET Standard 2.0 compatible
                                                  **netcoreapp2.0**
                                                  .NET Core 2.0 compatible
                                                  |netstandard2.0| +|licenseId|The identifier of the license| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| -|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| +|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| +|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| |optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| |optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| +|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| |optionalProjectFile|Generate {PackageName}.csproj.| |true| -|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| +|packageGuid|The GUID that will be associated with the C# project| |null| +|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| +|packageTags|Tags to identify the package| |null| +|packageVersion|C# package version.| |1.0.0| +|releaseNote|Release note, default to 'Minor update'.| |Minor update| +|returnICollection|Return ICollection<T> instead of the concrete type.| |false| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src| +|targetFramework|The target .NET framework version.|
                                                  **netstandard1.3**
                                                  .NET Standard 1.3 compatible
                                                  **netstandard1.4**
                                                  .NET Standard 1.4 compatible
                                                  **netstandard1.5**
                                                  .NET Standard 1.5 compatible
                                                  **netstandard1.6**
                                                  .NET Standard 1.6 compatible
                                                  **netstandard2.0**
                                                  .NET Standard 2.0 compatible
                                                  **netcoreapp2.0**
                                                  .NET Core 2.0 compatible
                                                  |netstandard2.0| +|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| +|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |validatable|Generates self-validatable models.| |true| -|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| ## IMPORT MAPPING @@ -44,133 +47,133 @@ sidebar_label: csharp-netcore ## LANGUAGE PRIMITIVES -
                                                  • int?
                                                  • -
                                                  • Dictionary
                                                  • -
                                                  • string
                                                  • -
                                                  • bool
                                                  • -
                                                  • DateTimeOffset?
                                                  • -
                                                  • String
                                                  • -
                                                  • Guid
                                                  • -
                                                  • System.IO.Stream
                                                  • -
                                                  • bool?
                                                  • -
                                                  • float
                                                  • -
                                                  • long
                                                  • +
                                                    • Boolean
                                                    • +
                                                    • Collection
                                                    • DateTime
                                                    • -
                                                    • Int32
                                                    • -
                                                    • float?
                                                    • DateTime?
                                                    • -
                                                    • List
                                                    • -
                                                    • Boolean
                                                    • -
                                                    • long?
                                                    • -
                                                    • double
                                                    • -
                                                    • Guid?
                                                    • DateTimeOffset
                                                    • +
                                                    • DateTimeOffset?
                                                    • +
                                                    • Dictionary
                                                    • Double
                                                    • -
                                                    • int
                                                    • -
                                                    • byte[]
                                                    • Float
                                                    • -
                                                    • Int64
                                                    • -
                                                    • double?
                                                    • +
                                                    • Guid
                                                    • +
                                                    • Guid?
                                                    • ICollection
                                                    • -
                                                    • Collection
                                                    • +
                                                    • Int32
                                                    • +
                                                    • Int64
                                                    • +
                                                    • List
                                                    • Object
                                                    • -
                                                    • decimal?
                                                    • +
                                                    • String
                                                    • +
                                                    • System.IO.Stream
                                                    • +
                                                    • bool
                                                    • +
                                                    • bool?
                                                    • +
                                                    • byte[]
                                                    • decimal
                                                    • +
                                                    • decimal?
                                                    • +
                                                    • double
                                                    • +
                                                    • double?
                                                    • +
                                                    • float
                                                    • +
                                                    • float?
                                                    • +
                                                    • int
                                                    • +
                                                    • int?
                                                    • +
                                                    • long
                                                    • +
                                                    • long?
                                                    • +
                                                    • string
                                                    ## RESERVED WORDS -
                                                    • struct
                                                    • -
                                                    • extern
                                                    • -
                                                    • do
                                                    • -
                                                    • ushort
                                                    • -
                                                    • float
                                                    • -
                                                    • while
                                                    • -
                                                    • operator
                                                    • -
                                                    • localVarQueryParams
                                                    • -
                                                    • ref
                                                    • -
                                                    • protected
                                                    • -
                                                    • readonly
                                                    • -
                                                    • continue
                                                    • -
                                                    • else
                                                    • -
                                                    • checked
                                                    • -
                                                    • lock
                                                    • -
                                                    • localVarPathParams
                                                    • -
                                                    • catch
                                                    • -
                                                    • Client
                                                    • -
                                                    • if
                                                    • -
                                                    • case
                                                    • -
                                                    • localVarHttpHeaderAccepts
                                                    • -
                                                    • new
                                                    • -
                                                    • using
                                                    • -
                                                    • static
                                                    • -
                                                    • void
                                                    • -
                                                    • localVarPostBody
                                                    • -
                                                    • in
                                                    • -
                                                    • sizeof
                                                    • -
                                                    • localVarResponse
                                                    • +
                                                      • Client
                                                      • +
                                                      • abstract
                                                      • +
                                                      • as
                                                      • +
                                                      • base
                                                      • +
                                                      • bool
                                                      • +
                                                      • break
                                                      • byte
                                                      • +
                                                      • case
                                                      • +
                                                      • catch
                                                      • +
                                                      • char
                                                      • +
                                                      • checked
                                                      • +
                                                      • class
                                                      • +
                                                      • client
                                                      • +
                                                      • const
                                                      • +
                                                      • continue
                                                      • +
                                                      • decimal
                                                      • +
                                                      • default
                                                      • +
                                                      • delegate
                                                      • +
                                                      • do
                                                      • double
                                                      • -
                                                      • sealed
                                                      • -
                                                      • finally
                                                      • -
                                                      • this
                                                      • -
                                                      • unchecked
                                                      • -
                                                      • is
                                                      • -
                                                      • params
                                                      • +
                                                      • else
                                                      • enum
                                                      • +
                                                      • event
                                                      • explicit
                                                      • -
                                                      • as
                                                      • -
                                                      • null
                                                      • -
                                                      • localVarPath
                                                      • -
                                                      • true
                                                      • +
                                                      • extern
                                                      • +
                                                      • false
                                                      • +
                                                      • finally
                                                      • fixed
                                                      • -
                                                      • try
                                                      • -
                                                      • decimal
                                                      • -
                                                      • object
                                                      • +
                                                      • float
                                                      • +
                                                      • for
                                                      • +
                                                      • foreach
                                                      • +
                                                      • goto
                                                      • +
                                                      • if
                                                      • implicit
                                                      • +
                                                      • in
                                                      • +
                                                      • int
                                                      • +
                                                      • interface
                                                      • internal
                                                      • -
                                                      • private
                                                      • -
                                                      • virtual
                                                      • -
                                                      • bool
                                                      • -
                                                      • const
                                                      • -
                                                      • string
                                                      • -
                                                      • for
                                                      • +
                                                      • is
                                                      • +
                                                      • localVarFileParams
                                                      • +
                                                      • localVarFormParams
                                                      • +
                                                      • localVarHeaderParams
                                                      • +
                                                      • localVarHttpContentType
                                                      • +
                                                      • localVarHttpContentTypes
                                                      • localVarHttpHeaderAccept
                                                      • -
                                                      • interface
                                                      • -
                                                      • unsafe
                                                      • +
                                                      • localVarHttpHeaderAccepts
                                                      • +
                                                      • localVarPath
                                                      • +
                                                      • localVarPathParams
                                                      • +
                                                      • localVarPostBody
                                                      • +
                                                      • localVarQueryParams
                                                      • +
                                                      • localVarResponse
                                                      • +
                                                      • localVarStatusCode
                                                      • +
                                                      • lock
                                                      • long
                                                      • +
                                                      • namespace
                                                      • +
                                                      • new
                                                      • +
                                                      • null
                                                      • +
                                                      • object
                                                      • +
                                                      • operator
                                                      • out
                                                      • -
                                                      • switch
                                                      • -
                                                      • delegate
                                                      • -
                                                      • foreach
                                                      • -
                                                      • default
                                                      • -
                                                      • ulong
                                                      • -
                                                      • goto
                                                      • -
                                                      • localVarHttpContentTypes
                                                      • -
                                                      • localVarHttpContentType
                                                      • +
                                                      • override
                                                      • +
                                                      • parameter
                                                      • +
                                                      • params
                                                      • +
                                                      • private
                                                      • +
                                                      • protected
                                                      • public
                                                      • -
                                                      • localVarStatusCode
                                                      • +
                                                      • readonly
                                                      • +
                                                      • ref
                                                      • +
                                                      • return
                                                      • +
                                                      • sbyte
                                                      • +
                                                      • sealed
                                                      • +
                                                      • short
                                                      • +
                                                      • sizeof
                                                      • stackalloc
                                                      • -
                                                      • parameter
                                                      • -
                                                      • client
                                                      • -
                                                      • override
                                                      • -
                                                      • event
                                                      • -
                                                      • class
                                                      • +
                                                      • static
                                                      • +
                                                      • string
                                                      • +
                                                      • struct
                                                      • +
                                                      • switch
                                                      • +
                                                      • this
                                                      • +
                                                      • throw
                                                      • +
                                                      • true
                                                      • +
                                                      • try
                                                      • typeof
                                                      • -
                                                      • localVarFormParams
                                                      • -
                                                      • break
                                                      • -
                                                      • false
                                                      • -
                                                      • volatile
                                                      • -
                                                      • abstract
                                                      • uint
                                                      • -
                                                      • int
                                                      • -
                                                      • localVarHeaderParams
                                                      • -
                                                      • throw
                                                      • -
                                                      • char
                                                      • -
                                                      • namespace
                                                      • -
                                                      • sbyte
                                                      • -
                                                      • short
                                                      • -
                                                      • localVarFileParams
                                                      • -
                                                      • return
                                                      • -
                                                      • base
                                                      • +
                                                      • ulong
                                                      • +
                                                      • unchecked
                                                      • +
                                                      • unsafe
                                                      • +
                                                      • ushort
                                                      • +
                                                      • using
                                                      • +
                                                      • virtual
                                                      • +
                                                      • void
                                                      • +
                                                      • volatile
                                                      • +
                                                      • while
                                                      diff --git a/docs/generators/csharp-refactor.md b/docs/generators/csharp-refactor.md deleted file mode 100644 index d9f571490004..000000000000 --- a/docs/generators/csharp-refactor.md +++ /dev/null @@ -1,29 +0,0 @@ - ---- -id: generator-opts-client-csharp-refactor -title: Config Options for csharp-refactor -sidebar_label: csharp-refactor ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| -|packageVersion|C# package version.| |1.0.0| -|sourceFolder|source folder for generated code| |src| -|packageGuid|The GUID that will be associated with the C# project| |null| -|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| -|targetFramework|The target .NET framework version.|
                                                      **netstandard1.3**
                                                      .NET Standard 1.3 compatible
                                                      **netstandard1.4**
                                                      .NET Standard 1.4 compatible
                                                      **netstandard1.5**
                                                      .NET Standard 1.5 compatible
                                                      **netstandard1.6**
                                                      .NET Standard 1.6 compatible
                                                      **netstandard2.0**
                                                      .NET Standard 2.0 compatible
                                                      **netcoreapp2.0**
                                                      .NET Core 2.0 compatible
                                                      |v4.6.1| -|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| -|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| -|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| -|optionalProjectFile|Generate {PackageName}.csproj.| |true| -|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| -|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| -|validatable|Generates self-validatable models.| |true| diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 731c734923cb..4ec890a4e8b5 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -5,29 +5,29 @@ sidebar_label: csharp | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| -|packageVersion|C# package version.| |1.0.0| -|sourceFolder|source folder for generated code| |src| -|packageGuid|The GUID that will be associated with the C# project| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| +|generatePropertyChanged|Specifies a AssemblyDescription for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I| -|targetFramework|The target .NET framework version.|
                                                      **v3.5**
                                                      .NET Framework 3.5 compatible
                                                      **v4.0**
                                                      .NET Framework 4.0 compatible
                                                      **v4.5**
                                                      .NET Framework 4.5+ compatible
                                                      **v5.0**
                                                      .NET Standard 1.3 compatible (DEPRECATED. Please use `csharp-netcore` generator instead)
                                                      **uwp**
                                                      Universal Windows Platform (DEPRECATED. Please use `csharp-netcore` generator instead)
                                                      |v4.5| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |PascalCase| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| -|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| +|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| +|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| |optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true| |optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false| +|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true| |optionalProjectFile|Generate {PackageName}.csproj.| |true| -|generatePropertyChanged|Specifies a AssemblyDescription for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |false| -|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|netCoreProjectFile|Use the new format (.NET Core) for .NET project files (.csproj).| |false| -|validatable|Generates self-validatable models.| |true| +|packageGuid|The GUID that will be associated with the C# project| |null| +|packageName|C# package name (convention: Title.Case).| |Org.OpenAPITools| +|packageVersion|C# package version.| |1.0.0| +|returnICollection|Return ICollection<T> instead of the concrete type.| |false| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src| +|targetFramework|The target .NET framework version.|
                                                      **v3.5**
                                                      .NET Framework 3.5 compatible
                                                      **v4.0**
                                                      .NET Framework 4.0 compatible
                                                      **v4.5**
                                                      .NET Framework 4.5+ compatible
                                                      **v5.0**
                                                      .NET Standard 1.3 compatible (DEPRECATED. Please use `csharp-netcore` generator instead)
                                                      **uwp**
                                                      Universal Windows Platform (DEPRECATED. Please use `csharp-netcore` generator instead)
                                                      |v4.5| +|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| |useCompareNetObjects|Use KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact.| |false| -|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive| |false| +|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| +|validatable|Generates self-validatable models.| |true| ## IMPORT MAPPING @@ -46,133 +46,133 @@ sidebar_label: csharp ## LANGUAGE PRIMITIVES -
                                                      • int?
                                                      • -
                                                      • Dictionary
                                                      • -
                                                      • string
                                                      • -
                                                      • bool
                                                      • -
                                                      • DateTimeOffset?
                                                      • -
                                                      • String
                                                      • -
                                                      • Guid
                                                      • -
                                                      • System.IO.Stream
                                                      • -
                                                      • bool?
                                                      • -
                                                      • float
                                                      • -
                                                      • long
                                                      • +
                                                        • Boolean
                                                        • +
                                                        • Collection
                                                        • DateTime
                                                        • -
                                                        • Int32
                                                        • -
                                                        • float?
                                                        • DateTime?
                                                        • -
                                                        • List
                                                        • -
                                                        • Boolean
                                                        • -
                                                        • long?
                                                        • -
                                                        • double
                                                        • -
                                                        • Guid?
                                                        • DateTimeOffset
                                                        • +
                                                        • DateTimeOffset?
                                                        • +
                                                        • Dictionary
                                                        • Double
                                                        • -
                                                        • int
                                                        • -
                                                        • byte[]
                                                        • Float
                                                        • -
                                                        • Int64
                                                        • -
                                                        • double?
                                                        • +
                                                        • Guid
                                                        • +
                                                        • Guid?
                                                        • ICollection
                                                        • -
                                                        • Collection
                                                        • +
                                                        • Int32
                                                        • +
                                                        • Int64
                                                        • +
                                                        • List
                                                        • Object
                                                        • -
                                                        • decimal?
                                                        • +
                                                        • String
                                                        • +
                                                        • System.IO.Stream
                                                        • +
                                                        • bool
                                                        • +
                                                        • bool?
                                                        • +
                                                        • byte[]
                                                        • decimal
                                                        • +
                                                        • decimal?
                                                        • +
                                                        • double
                                                        • +
                                                        • double?
                                                        • +
                                                        • float
                                                        • +
                                                        • float?
                                                        • +
                                                        • int
                                                        • +
                                                        • int?
                                                        • +
                                                        • long
                                                        • +
                                                        • long?
                                                        • +
                                                        • string
                                                        ## RESERVED WORDS -
                                                        • struct
                                                        • -
                                                        • extern
                                                        • -
                                                        • do
                                                        • -
                                                        • ushort
                                                        • -
                                                        • float
                                                        • -
                                                        • while
                                                        • -
                                                        • operator
                                                        • -
                                                        • localVarQueryParams
                                                        • -
                                                        • ref
                                                        • -
                                                        • protected
                                                        • -
                                                        • readonly
                                                        • -
                                                        • continue
                                                        • -
                                                        • else
                                                        • -
                                                        • checked
                                                        • -
                                                        • lock
                                                        • -
                                                        • localVarPathParams
                                                        • -
                                                        • catch
                                                        • -
                                                        • Client
                                                        • -
                                                        • if
                                                        • -
                                                        • case
                                                        • -
                                                        • localVarHttpHeaderAccepts
                                                        • -
                                                        • new
                                                        • -
                                                        • using
                                                        • -
                                                        • static
                                                        • -
                                                        • void
                                                        • -
                                                        • localVarPostBody
                                                        • -
                                                        • in
                                                        • -
                                                        • sizeof
                                                        • -
                                                        • localVarResponse
                                                        • +
                                                          • Client
                                                          • +
                                                          • abstract
                                                          • +
                                                          • as
                                                          • +
                                                          • base
                                                          • +
                                                          • bool
                                                          • +
                                                          • break
                                                          • byte
                                                          • +
                                                          • case
                                                          • +
                                                          • catch
                                                          • +
                                                          • char
                                                          • +
                                                          • checked
                                                          • +
                                                          • class
                                                          • +
                                                          • client
                                                          • +
                                                          • const
                                                          • +
                                                          • continue
                                                          • +
                                                          • decimal
                                                          • +
                                                          • default
                                                          • +
                                                          • delegate
                                                          • +
                                                          • do
                                                          • double
                                                          • -
                                                          • sealed
                                                          • -
                                                          • finally
                                                          • -
                                                          • this
                                                          • -
                                                          • unchecked
                                                          • -
                                                          • is
                                                          • -
                                                          • params
                                                          • +
                                                          • else
                                                          • enum
                                                          • +
                                                          • event
                                                          • explicit
                                                          • -
                                                          • as
                                                          • -
                                                          • null
                                                          • -
                                                          • localVarPath
                                                          • -
                                                          • true
                                                          • +
                                                          • extern
                                                          • +
                                                          • false
                                                          • +
                                                          • finally
                                                          • fixed
                                                          • -
                                                          • try
                                                          • -
                                                          • decimal
                                                          • -
                                                          • object
                                                          • +
                                                          • float
                                                          • +
                                                          • for
                                                          • +
                                                          • foreach
                                                          • +
                                                          • goto
                                                          • +
                                                          • if
                                                          • implicit
                                                          • +
                                                          • in
                                                          • +
                                                          • int
                                                          • +
                                                          • interface
                                                          • internal
                                                          • -
                                                          • private
                                                          • -
                                                          • virtual
                                                          • -
                                                          • bool
                                                          • -
                                                          • const
                                                          • -
                                                          • string
                                                          • -
                                                          • for
                                                          • +
                                                          • is
                                                          • +
                                                          • localVarFileParams
                                                          • +
                                                          • localVarFormParams
                                                          • +
                                                          • localVarHeaderParams
                                                          • +
                                                          • localVarHttpContentType
                                                          • +
                                                          • localVarHttpContentTypes
                                                          • localVarHttpHeaderAccept
                                                          • -
                                                          • interface
                                                          • -
                                                          • unsafe
                                                          • +
                                                          • localVarHttpHeaderAccepts
                                                          • +
                                                          • localVarPath
                                                          • +
                                                          • localVarPathParams
                                                          • +
                                                          • localVarPostBody
                                                          • +
                                                          • localVarQueryParams
                                                          • +
                                                          • localVarResponse
                                                          • +
                                                          • localVarStatusCode
                                                          • +
                                                          • lock
                                                          • long
                                                          • +
                                                          • namespace
                                                          • +
                                                          • new
                                                          • +
                                                          • null
                                                          • +
                                                          • object
                                                          • +
                                                          • operator
                                                          • out
                                                          • -
                                                          • switch
                                                          • -
                                                          • delegate
                                                          • -
                                                          • foreach
                                                          • -
                                                          • default
                                                          • -
                                                          • ulong
                                                          • -
                                                          • goto
                                                          • -
                                                          • localVarHttpContentTypes
                                                          • -
                                                          • localVarHttpContentType
                                                          • +
                                                          • override
                                                          • +
                                                          • parameter
                                                          • +
                                                          • params
                                                          • +
                                                          • private
                                                          • +
                                                          • protected
                                                          • public
                                                          • -
                                                          • localVarStatusCode
                                                          • +
                                                          • readonly
                                                          • +
                                                          • ref
                                                          • +
                                                          • return
                                                          • +
                                                          • sbyte
                                                          • +
                                                          • sealed
                                                          • +
                                                          • short
                                                          • +
                                                          • sizeof
                                                          • stackalloc
                                                          • -
                                                          • parameter
                                                          • -
                                                          • client
                                                          • -
                                                          • override
                                                          • -
                                                          • event
                                                          • -
                                                          • class
                                                          • +
                                                          • static
                                                          • +
                                                          • string
                                                          • +
                                                          • struct
                                                          • +
                                                          • switch
                                                          • +
                                                          • this
                                                          • +
                                                          • throw
                                                          • +
                                                          • true
                                                          • +
                                                          • try
                                                          • typeof
                                                          • -
                                                          • localVarFormParams
                                                          • -
                                                          • break
                                                          • -
                                                          • false
                                                          • -
                                                          • volatile
                                                          • -
                                                          • abstract
                                                          • uint
                                                          • -
                                                          • int
                                                          • -
                                                          • localVarHeaderParams
                                                          • -
                                                          • throw
                                                          • -
                                                          • char
                                                          • -
                                                          • namespace
                                                          • -
                                                          • sbyte
                                                          • -
                                                          • short
                                                          • -
                                                          • localVarFileParams
                                                          • -
                                                          • return
                                                          • -
                                                          • base
                                                          • +
                                                          • ulong
                                                          • +
                                                          • unchecked
                                                          • +
                                                          • unsafe
                                                          • +
                                                          • ushort
                                                          • +
                                                          • using
                                                          • +
                                                          • virtual
                                                          • +
                                                          • void
                                                          • +
                                                          • volatile
                                                          • +
                                                          • while
                                                          diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index 7f3a29158bf7..9765e1cc584c 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -5,21 +5,21 @@ sidebar_label: cwiki | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|appName|short name of the application| |null| |appDescription|description of the application| |null| -|infoUrl|a URL where users can get more information about the application| |null| +|appName|short name of the application| |null| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| +|infoUrl|a URL where users can get more information about the application| |null| +|invokerPackage|root package for generated code| |null| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| -|invokerPackage|root package for generated code| |null| -|groupId|groupId in generated pom.xml| |null| -|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|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| ## IMPORT MAPPING diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index bf003117202e..3445c7e16581 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -5,32 +5,32 @@ sidebar_label: dart-dio | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |browserClient|Is the client browser based (for Dart 1.x only)| |null| -|pubName|Name in generated pubspec| |null| -|pubVersion|Version in generated pubspec| |null| -|pubDescription|Description in generated pubspec| |null| +|dateLibrary|Option. Date library to use|
                                                          **core**
                                                          Dart core library (DateTime)
                                                          **timemachine**
                                                          Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
                                                          |core| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|nullableFields|Is the null fields should be in the JSON payload| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| |pubAuthorEmail|Email address of the author in generated pubspec| |null| +|pubDescription|Description in generated pubspec| |null| |pubHomepage|Homepage in generated pubspec| |null| -|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| +|pubName|Name in generated pubspec| |null| +|pubVersion|Version in generated pubspec| |null| +|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| |supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| -|nullableFields|Is the null fields should be in the JSON payload| |null| -|dateLibrary|Option. Date library to use|
                                                          **core**
                                                          Dart core library (DateTime)
                                                          **timemachine**
                                                          Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
                                                          |core| +|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | +|BuiltList|package:built_collection/built_collection.dart| |BuiltMap|package:built_collection/built_collection.dart| |JsonObject|package:built_value/json_object.dart| |Uint8List|dart:typed_data| -|BuiltList|package:built_collection/built_collection.dart| ## INSTANTIATION TYPES @@ -43,82 +43,82 @@ sidebar_label: dart-dio ## LANGUAGE PRIMITIVES -
                                                          • bool
                                                          • +
                                                            • String
                                                            • +
                                                            • bool
                                                            • double
                                                            • -
                                                            • num
                                                            • -
                                                            • String
                                                            • int
                                                            • +
                                                            • num
                                                            ## RESERVED WORDS -
                                                            • do
                                                            • -
                                                            • source
                                                            • -
                                                            • while
                                                            • -
                                                            • operator
                                                            • -
                                                            • required
                                                            • -
                                                            • patch
                                                            • -
                                                            • late
                                                            • +
                                                              • abstract
                                                              • +
                                                              • as
                                                              • +
                                                              • assert
                                                              • +
                                                              • async
                                                              • +
                                                              • await
                                                              • +
                                                              • break
                                                              • +
                                                              • case
                                                              • +
                                                              • catch
                                                              • +
                                                              • class
                                                              • +
                                                              • const
                                                              • continue
                                                              • -
                                                              • else
                                                              • -
                                                              • function
                                                              • +
                                                              • covariant
                                                              • +
                                                              • default
                                                              • +
                                                              • deferred
                                                              • +
                                                              • do
                                                              • dynamic
                                                              • -
                                                              • catch
                                                              • -
                                                              • export
                                                              • -
                                                              • if
                                                              • -
                                                              • case
                                                              • -
                                                              • new
                                                              • -
                                                              • static
                                                              • -
                                                              • void
                                                              • -
                                                              • in
                                                              • -
                                                              • var
                                                              • -
                                                              • finally
                                                              • -
                                                              • this
                                                              • -
                                                              • is
                                                              • -
                                                              • sync
                                                              • -
                                                              • typedef
                                                              • +
                                                              • else
                                                              • enum
                                                              • -
                                                              • covariant
                                                              • -
                                                              • mixin
                                                              • -
                                                              • as
                                                              • -
                                                              • external
                                                              • +
                                                              • export
                                                              • extends
                                                              • -
                                                              • null
                                                              • +
                                                              • extension
                                                              • +
                                                              • external
                                                              • +
                                                              • factory
                                                              • +
                                                              • false
                                                              • final
                                                              • -
                                                              • true
                                                              • -
                                                              • try
                                                              • +
                                                              • finally
                                                              • +
                                                              • for
                                                              • +
                                                              • function
                                                              • +
                                                              • get
                                                              • +
                                                              • hide
                                                              • +
                                                              • if
                                                              • implements
                                                              • -
                                                              • deferred
                                                              • -
                                                              • extension
                                                              • -
                                                              • const
                                                              • import
                                                              • -
                                                              • part
                                                              • -
                                                              • for
                                                              • -
                                                              • show
                                                              • +
                                                              • in
                                                              • +
                                                              • inout
                                                              • interface
                                                              • -
                                                              • out
                                                              • -
                                                              • switch
                                                              • -
                                                              • default
                                                              • +
                                                              • is
                                                              • +
                                                              • late
                                                              • library
                                                              • +
                                                              • mixin
                                                              • native
                                                              • -
                                                              • assert
                                                              • -
                                                              • get
                                                              • +
                                                              • new
                                                              • +
                                                              • null
                                                              • of
                                                              • -
                                                              • yield
                                                              • -
                                                              • await
                                                              • -
                                                              • class
                                                              • on
                                                              • +
                                                              • operator
                                                              • +
                                                              • out
                                                              • +
                                                              • part
                                                              • +
                                                              • patch
                                                              • +
                                                              • required
                                                              • rethrow
                                                              • -
                                                              • factory
                                                              • +
                                                              • return
                                                              • set
                                                              • -
                                                              • break
                                                              • -
                                                              • false
                                                              • -
                                                              • abstract
                                                              • +
                                                              • show
                                                              • +
                                                              • source
                                                              • +
                                                              • static
                                                              • super
                                                              • -
                                                              • async
                                                              • -
                                                              • with
                                                              • -
                                                              • hide
                                                              • -
                                                              • inout
                                                              • +
                                                              • switch
                                                              • +
                                                              • sync
                                                              • +
                                                              • this
                                                              • throw
                                                              • -
                                                              • return
                                                              • +
                                                              • true
                                                              • +
                                                              • try
                                                              • +
                                                              • typedef
                                                              • +
                                                              • var
                                                              • +
                                                              • void
                                                              • +
                                                              • while
                                                              • +
                                                              • with
                                                              • +
                                                              • yield
                                                              diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 631c13c3b6fd..78f1eac7d5d7 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -5,23 +5,23 @@ sidebar_label: dart-jaguar | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |browserClient|Is the client browser based (for Dart 1.x only)| |null| -|pubName|Name in generated pubspec| |null| -|pubVersion|Version in generated pubspec| |null| -|pubDescription|Description in generated pubspec| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|nullableFields|Is the null fields should be in the JSON payload| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| |pubAuthorEmail|Email address of the author in generated pubspec| |null| +|pubDescription|Description in generated pubspec| |null| |pubHomepage|Homepage in generated pubspec| |null| -|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| +|pubName|Name in generated pubspec| |null| +|pubVersion|Version in generated pubspec| |null| +|serialization|Choose serialization format JSON or PROTO is supported| |null| +|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| |supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| -|nullableFields|Is the null fields should be in the JSON payload| |null| -|serialization|Choose serialization format JSON or PROTO is supported| |null| +|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| ## IMPORT MAPPING @@ -39,82 +39,82 @@ sidebar_label: dart-jaguar ## LANGUAGE PRIMITIVES -
                                                              • bool
                                                              • +
                                                                • String
                                                                • +
                                                                • bool
                                                                • double
                                                                • -
                                                                • num
                                                                • -
                                                                • String
                                                                • int
                                                                • +
                                                                • num
                                                                ## RESERVED WORDS -
                                                                • do
                                                                • -
                                                                • source
                                                                • -
                                                                • while
                                                                • -
                                                                • operator
                                                                • -
                                                                • required
                                                                • -
                                                                • patch
                                                                • -
                                                                • late
                                                                • +
                                                                  • abstract
                                                                  • +
                                                                  • as
                                                                  • +
                                                                  • assert
                                                                  • +
                                                                  • async
                                                                  • +
                                                                  • await
                                                                  • +
                                                                  • break
                                                                  • +
                                                                  • case
                                                                  • +
                                                                  • catch
                                                                  • +
                                                                  • class
                                                                  • +
                                                                  • const
                                                                  • continue
                                                                  • -
                                                                  • else
                                                                  • -
                                                                  • function
                                                                  • +
                                                                  • covariant
                                                                  • +
                                                                  • default
                                                                  • +
                                                                  • deferred
                                                                  • +
                                                                  • do
                                                                  • dynamic
                                                                  • -
                                                                  • catch
                                                                  • -
                                                                  • export
                                                                  • -
                                                                  • if
                                                                  • -
                                                                  • case
                                                                  • -
                                                                  • new
                                                                  • -
                                                                  • static
                                                                  • -
                                                                  • void
                                                                  • -
                                                                  • in
                                                                  • -
                                                                  • var
                                                                  • -
                                                                  • finally
                                                                  • -
                                                                  • this
                                                                  • -
                                                                  • is
                                                                  • -
                                                                  • sync
                                                                  • -
                                                                  • typedef
                                                                  • +
                                                                  • else
                                                                  • enum
                                                                  • -
                                                                  • covariant
                                                                  • -
                                                                  • mixin
                                                                  • -
                                                                  • as
                                                                  • -
                                                                  • external
                                                                  • +
                                                                  • export
                                                                  • extends
                                                                  • -
                                                                  • null
                                                                  • +
                                                                  • extension
                                                                  • +
                                                                  • external
                                                                  • +
                                                                  • factory
                                                                  • +
                                                                  • false
                                                                  • final
                                                                  • -
                                                                  • true
                                                                  • -
                                                                  • try
                                                                  • +
                                                                  • finally
                                                                  • +
                                                                  • for
                                                                  • +
                                                                  • function
                                                                  • +
                                                                  • get
                                                                  • +
                                                                  • hide
                                                                  • +
                                                                  • if
                                                                  • implements
                                                                  • -
                                                                  • deferred
                                                                  • -
                                                                  • extension
                                                                  • -
                                                                  • const
                                                                  • import
                                                                  • -
                                                                  • part
                                                                  • -
                                                                  • for
                                                                  • -
                                                                  • show
                                                                  • +
                                                                  • in
                                                                  • +
                                                                  • inout
                                                                  • interface
                                                                  • -
                                                                  • out
                                                                  • -
                                                                  • switch
                                                                  • -
                                                                  • default
                                                                  • +
                                                                  • is
                                                                  • +
                                                                  • late
                                                                  • library
                                                                  • +
                                                                  • mixin
                                                                  • native
                                                                  • -
                                                                  • assert
                                                                  • -
                                                                  • get
                                                                  • +
                                                                  • new
                                                                  • +
                                                                  • null
                                                                  • of
                                                                  • -
                                                                  • yield
                                                                  • -
                                                                  • await
                                                                  • -
                                                                  • class
                                                                  • on
                                                                  • +
                                                                  • operator
                                                                  • +
                                                                  • out
                                                                  • +
                                                                  • part
                                                                  • +
                                                                  • patch
                                                                  • +
                                                                  • required
                                                                  • rethrow
                                                                  • -
                                                                  • factory
                                                                  • +
                                                                  • return
                                                                  • set
                                                                  • -
                                                                  • break
                                                                  • -
                                                                  • false
                                                                  • -
                                                                  • abstract
                                                                  • +
                                                                  • show
                                                                  • +
                                                                  • source
                                                                  • +
                                                                  • static
                                                                  • super
                                                                  • -
                                                                  • async
                                                                  • -
                                                                  • with
                                                                  • -
                                                                  • hide
                                                                  • -
                                                                  • inout
                                                                  • +
                                                                  • switch
                                                                  • +
                                                                  • sync
                                                                  • +
                                                                  • this
                                                                  • throw
                                                                  • -
                                                                  • return
                                                                  • +
                                                                  • true
                                                                  • +
                                                                  • try
                                                                  • +
                                                                  • typedef
                                                                  • +
                                                                  • var
                                                                  • +
                                                                  • void
                                                                  • +
                                                                  • while
                                                                  • +
                                                                  • with
                                                                  • +
                                                                  • yield
                                                                  diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 779ddf7c1871..8b1bd158c300 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -5,21 +5,21 @@ sidebar_label: dart | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |browserClient|Is the client browser based (for Dart 1.x only)| |null| -|pubName|Name in generated pubspec| |null| -|pubVersion|Version in generated pubspec| |null| -|pubDescription|Description in generated pubspec| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| |pubAuthorEmail|Email address of the author in generated pubspec| |null| +|pubDescription|Description in generated pubspec| |null| |pubHomepage|Homepage in generated pubspec| |null| -|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| +|pubName|Name in generated pubspec| |null| +|pubVersion|Version in generated pubspec| |null| +|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| |supportDart2|Support Dart 2.x (Dart 1.x support has been deprecated)| |true| +|useEnumExtension|Allow the 'x-enum-values' extension for enums| |null| ## IMPORT MAPPING @@ -37,82 +37,82 @@ sidebar_label: dart ## LANGUAGE PRIMITIVES -
                                                                  • bool
                                                                  • +
                                                                    • String
                                                                    • +
                                                                    • bool
                                                                    • double
                                                                    • -
                                                                    • num
                                                                    • -
                                                                    • String
                                                                    • int
                                                                    • +
                                                                    • num
                                                                    ## RESERVED WORDS -
                                                                    • do
                                                                    • -
                                                                    • source
                                                                    • -
                                                                    • while
                                                                    • -
                                                                    • operator
                                                                    • -
                                                                    • required
                                                                    • -
                                                                    • patch
                                                                    • -
                                                                    • late
                                                                    • +
                                                                      • abstract
                                                                      • +
                                                                      • as
                                                                      • +
                                                                      • assert
                                                                      • +
                                                                      • async
                                                                      • +
                                                                      • await
                                                                      • +
                                                                      • break
                                                                      • +
                                                                      • case
                                                                      • +
                                                                      • catch
                                                                      • +
                                                                      • class
                                                                      • +
                                                                      • const
                                                                      • continue
                                                                      • -
                                                                      • else
                                                                      • -
                                                                      • function
                                                                      • +
                                                                      • covariant
                                                                      • +
                                                                      • default
                                                                      • +
                                                                      • deferred
                                                                      • +
                                                                      • do
                                                                      • dynamic
                                                                      • -
                                                                      • catch
                                                                      • -
                                                                      • export
                                                                      • -
                                                                      • if
                                                                      • -
                                                                      • case
                                                                      • -
                                                                      • new
                                                                      • -
                                                                      • static
                                                                      • -
                                                                      • void
                                                                      • -
                                                                      • in
                                                                      • -
                                                                      • var
                                                                      • -
                                                                      • finally
                                                                      • -
                                                                      • this
                                                                      • -
                                                                      • is
                                                                      • -
                                                                      • sync
                                                                      • -
                                                                      • typedef
                                                                      • +
                                                                      • else
                                                                      • enum
                                                                      • -
                                                                      • covariant
                                                                      • -
                                                                      • mixin
                                                                      • -
                                                                      • as
                                                                      • -
                                                                      • external
                                                                      • +
                                                                      • export
                                                                      • extends
                                                                      • -
                                                                      • null
                                                                      • +
                                                                      • extension
                                                                      • +
                                                                      • external
                                                                      • +
                                                                      • factory
                                                                      • +
                                                                      • false
                                                                      • final
                                                                      • -
                                                                      • true
                                                                      • -
                                                                      • try
                                                                      • +
                                                                      • finally
                                                                      • +
                                                                      • for
                                                                      • +
                                                                      • function
                                                                      • +
                                                                      • get
                                                                      • +
                                                                      • hide
                                                                      • +
                                                                      • if
                                                                      • implements
                                                                      • -
                                                                      • deferred
                                                                      • -
                                                                      • extension
                                                                      • -
                                                                      • const
                                                                      • import
                                                                      • -
                                                                      • part
                                                                      • -
                                                                      • for
                                                                      • -
                                                                      • show
                                                                      • +
                                                                      • in
                                                                      • +
                                                                      • inout
                                                                      • interface
                                                                      • -
                                                                      • out
                                                                      • -
                                                                      • switch
                                                                      • -
                                                                      • default
                                                                      • +
                                                                      • is
                                                                      • +
                                                                      • late
                                                                      • library
                                                                      • +
                                                                      • mixin
                                                                      • native
                                                                      • -
                                                                      • assert
                                                                      • -
                                                                      • get
                                                                      • +
                                                                      • new
                                                                      • +
                                                                      • null
                                                                      • of
                                                                      • -
                                                                      • yield
                                                                      • -
                                                                      • await
                                                                      • -
                                                                      • class
                                                                      • on
                                                                      • +
                                                                      • operator
                                                                      • +
                                                                      • out
                                                                      • +
                                                                      • part
                                                                      • +
                                                                      • patch
                                                                      • +
                                                                      • required
                                                                      • rethrow
                                                                      • -
                                                                      • factory
                                                                      • +
                                                                      • return
                                                                      • set
                                                                      • -
                                                                      • break
                                                                      • -
                                                                      • false
                                                                      • -
                                                                      • abstract
                                                                      • +
                                                                      • show
                                                                      • +
                                                                      • source
                                                                      • +
                                                                      • static
                                                                      • super
                                                                      • -
                                                                      • async
                                                                      • -
                                                                      • with
                                                                      • -
                                                                      • hide
                                                                      • -
                                                                      • inout
                                                                      • +
                                                                      • switch
                                                                      • +
                                                                      • sync
                                                                      • +
                                                                      • this
                                                                      • throw
                                                                      • -
                                                                      • return
                                                                      • +
                                                                      • true
                                                                      • +
                                                                      • try
                                                                      • +
                                                                      • typedef
                                                                      • +
                                                                      • var
                                                                      • +
                                                                      • void
                                                                      • +
                                                                      • while
                                                                      • +
                                                                      • with
                                                                      • +
                                                                      • yield
                                                                      diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index 7527655ca39f..1fa63d343487 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -5,15 +5,15 @@ sidebar_label: dynamic-html | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|invokerPackage|root package for generated code| |null| -|groupId|groupId in generated pom.xml| |null| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|groupId|groupId in generated pom.xml| |null| +|invokerPackage|root package for generated code| |null| +|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| ## IMPORT MAPPING diff --git a/docs/generators/eiffel.md b/docs/generators/eiffel.md index 9b853a32d839..2f239b7c407b 100644 --- a/docs/generators/eiffel.md +++ b/docs/generators/eiffel.md @@ -5,30 +5,30 @@ sidebar_label: eiffel | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |packageName|Eiffel Cluster name (convention: lowercase).| |openapi| |packageVersion|Eiffel package version.| |1.0.0| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -42,79 +42,79 @@ sidebar_label: eiffel ## LANGUAGE PRIMITIVES -
                                                                      • INTEGER_16
                                                                      • -
                                                                      • NATURAL_16
                                                                      • -
                                                                      • INTEGER_8
                                                                      • -
                                                                      • REAL_32
                                                                      • +
                                                                        • BOOLEAN
                                                                        • +
                                                                        • INTEGER_16
                                                                        • INTEGER_32
                                                                        • INTEGER_64
                                                                        • -
                                                                        • REAL_64
                                                                        • -
                                                                        • NATURAL_8
                                                                        • -
                                                                        • BOOLEAN
                                                                        • -
                                                                        • NATURAL_64
                                                                        • +
                                                                        • INTEGER_8
                                                                        • +
                                                                        • NATURAL_16
                                                                        • NATURAL_32
                                                                        • +
                                                                        • NATURAL_64
                                                                        • +
                                                                        • NATURAL_8
                                                                        • +
                                                                        • REAL_32
                                                                        • +
                                                                        • REAL_64
                                                                        ## RESERVED WORDS -
                                                                        • agent
                                                                        • -
                                                                        • select
                                                                        • -
                                                                        • separate
                                                                        • +
                                                                          • across
                                                                          • +
                                                                          • agent
                                                                          • +
                                                                          • alias
                                                                          • +
                                                                          • all
                                                                          • +
                                                                          • and
                                                                          • +
                                                                          • as
                                                                          • +
                                                                          • assign
                                                                          • +
                                                                          • attribute
                                                                          • +
                                                                          • check
                                                                          • +
                                                                          • class
                                                                          • convert
                                                                          • +
                                                                          • create
                                                                          • +
                                                                          • current
                                                                          • +
                                                                          • debug
                                                                          • +
                                                                          • deferred
                                                                          • do
                                                                          • -
                                                                          • when
                                                                          • else
                                                                          • -
                                                                          • loop
                                                                          • elseif
                                                                          • -
                                                                          • only
                                                                          • -
                                                                          • precursor
                                                                          • -
                                                                          • variant
                                                                          • -
                                                                          • create
                                                                          • -
                                                                          • from
                                                                          • -
                                                                          • export
                                                                          • -
                                                                          • if
                                                                          • -
                                                                          • all
                                                                          • +
                                                                          • end
                                                                          • ensure
                                                                          • -
                                                                          • void
                                                                          • -
                                                                          • like
                                                                          • -
                                                                          • old
                                                                          • -
                                                                          • frozen
                                                                          • -
                                                                          • require
                                                                          • -
                                                                          • check
                                                                          • -
                                                                          • then
                                                                          • -
                                                                          • undefine
                                                                          • -
                                                                          • invariant
                                                                          • -
                                                                          • as
                                                                          • +
                                                                          • expanded
                                                                          • +
                                                                          • export
                                                                          • external
                                                                          • -
                                                                          • once
                                                                          • +
                                                                          • false
                                                                          • +
                                                                          • feature
                                                                          • +
                                                                          • from
                                                                          • +
                                                                          • frozen
                                                                          • +
                                                                          • if
                                                                          • +
                                                                          • implies
                                                                          • +
                                                                          • inherit
                                                                          • inspect
                                                                          • -
                                                                          • true
                                                                          • -
                                                                          • deferred
                                                                          • +
                                                                          • invariant
                                                                          • +
                                                                          • like
                                                                          • +
                                                                          • local
                                                                          • +
                                                                          • loop
                                                                          • +
                                                                          • not
                                                                          • note
                                                                          • obsolete
                                                                          • -
                                                                          • local
                                                                          • -
                                                                          • result
                                                                          • -
                                                                          • across
                                                                          • +
                                                                          • old
                                                                          • +
                                                                          • once
                                                                          • +
                                                                          • only
                                                                          • +
                                                                          • or
                                                                          • +
                                                                          • precursor
                                                                          • redefine
                                                                          • -
                                                                          • tuple
                                                                          • -
                                                                          • current
                                                                          • -
                                                                          • expanded
                                                                          • -
                                                                          • not
                                                                          • -
                                                                          • feature
                                                                          • -
                                                                          • and
                                                                          • -
                                                                          • alias
                                                                          • -
                                                                          • end
                                                                          • -
                                                                          • xor
                                                                          • -
                                                                          • attribute
                                                                          • -
                                                                          • class
                                                                          • +
                                                                          • rename
                                                                          • +
                                                                          • require
                                                                          • rescue
                                                                          • +
                                                                          • result
                                                                          • retry
                                                                          • -
                                                                          • debug
                                                                          • -
                                                                          • or
                                                                          • -
                                                                          • false
                                                                          • -
                                                                          • rename
                                                                          • -
                                                                          • inherit
                                                                          • +
                                                                          • select
                                                                          • +
                                                                          • separate
                                                                          • +
                                                                          • then
                                                                          • +
                                                                          • true
                                                                          • +
                                                                          • tuple
                                                                          • +
                                                                          • undefine
                                                                          • until
                                                                          • -
                                                                          • implies
                                                                          • -
                                                                          • assign
                                                                          • +
                                                                          • variant
                                                                          • +
                                                                          • void
                                                                          • +
                                                                          • when
                                                                          • +
                                                                          • xor
                                                                          diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index 47c9405e6fa8..fae1d80bd379 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -5,35 +5,35 @@ sidebar_label: elixir | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay.Pets| |null| |licenseHeader|The license header to prepend to the top of all source files.| |null| |packageName|Elixir package name (convention: lowercase).| |null| +|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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -44,26 +44,26 @@ sidebar_label: elixir ## LANGUAGE PRIMITIVES -
                                                                          • Integer
                                                                          • +
                                                                            • Atom
                                                                            • +
                                                                            • Boolean
                                                                            • +
                                                                            • DateTime
                                                                            • Float
                                                                            • +
                                                                            • Integer
                                                                            • List
                                                                            • +
                                                                            • Map
                                                                            • PID
                                                                            • String
                                                                            • -
                                                                            • Boolean
                                                                            • -
                                                                            • Map
                                                                            • -
                                                                            • Atom
                                                                            • Tuple
                                                                            • -
                                                                            • DateTime
                                                                            ## RESERVED WORDS -
                                                                            • nil
                                                                            • +
                                                                              • __CALLER__
                                                                              • __DIR__
                                                                              • __ENV__
                                                                              • -
                                                                              • __CALLER__
                                                                              • __FILE__
                                                                              • -
                                                                              • true
                                                                              • -
                                                                              • false
                                                                              • __MODULE__
                                                                              • +
                                                                              • false
                                                                              • +
                                                                              • nil
                                                                              • +
                                                                              • true
                                                                              diff --git a/docs/generators/elm.md b/docs/generators/elm.md index 3c1fabd6607b..aa3fe4f49bdf 100644 --- a/docs/generators/elm.md +++ b/docs/generators/elm.md @@ -5,10 +5,10 @@ sidebar_label: elm | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|elmVersion|Elm version: 0.18, 0.19|
                                                                              **0.19**
                                                                              Elm 0.19
                                                                              **0.18**
                                                                              Elm 0.18
                                                                              |0.19| -|elmPrefixCustomTypeVariants|Prefix custom type variants| |false| |elmEnableCustomBasePaths|Enable setting the base path for each request| |false| |elmEnableHttpRequestTrackers|Enable adding a tracker to each http request| |false| +|elmPrefixCustomTypeVariants|Prefix custom type variants| |false| +|elmVersion|Elm version: 0.18, 0.19|
                                                                              **0.19**
                                                                              Elm 0.19
                                                                              **0.18**
                                                                              Elm 0.18
                                                                              |0.19| ## IMPORT MAPPING @@ -26,28 +26,28 @@ sidebar_label: elm ## LANGUAGE PRIMITIVES -
                                                                              • Float
                                                                              • -
                                                                              • Bool
                                                                              • +
                                                                                • Bool
                                                                                • Dict
                                                                                • +
                                                                                • Float
                                                                                • +
                                                                                • Int
                                                                                • List
                                                                                • String
                                                                                • -
                                                                                • Int
                                                                                ## RESERVED WORDS -
                                                                                • import
                                                                                • +
                                                                                  • as
                                                                                  • +
                                                                                  • case
                                                                                  • +
                                                                                  • else
                                                                                  • +
                                                                                  • exposing
                                                                                  • +
                                                                                  • if
                                                                                  • +
                                                                                  • import
                                                                                  • in
                                                                                  • +
                                                                                  • let
                                                                                  • module
                                                                                  • +
                                                                                  • of
                                                                                  • +
                                                                                  • port
                                                                                  • then
                                                                                  • type
                                                                                  • -
                                                                                  • exposing
                                                                                  • -
                                                                                  • as
                                                                                  • -
                                                                                  • port
                                                                                  • -
                                                                                  • else
                                                                                  • -
                                                                                  • of
                                                                                  • -
                                                                                  • let
                                                                                  • where
                                                                                  • -
                                                                                  • if
                                                                                  • -
                                                                                  • case
                                                                                  diff --git a/docs/generators/erlang-client.md b/docs/generators/erlang-client.md index cc4454bcd4de..72e4df60613c 100644 --- a/docs/generators/erlang-client.md +++ b/docs/generators/erlang-client.md @@ -6,28 +6,28 @@ sidebar_label: erlang-client | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |packageName|Erlang application name (convention: lowercase).| |openapi| -|packageName|Erlang application version| |1.0.0| +|packageVersion|Erlang application version| |1.0.0| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -42,31 +42,31 @@ sidebar_label: erlang-client ## RESERVED WORDS -
                                                                                  • bsr
                                                                                  • -
                                                                                  • orelse
                                                                                  • +
                                                                                    • after
                                                                                    • +
                                                                                    • and
                                                                                    • +
                                                                                    • andalso
                                                                                    • +
                                                                                    • band
                                                                                    • +
                                                                                    • begin
                                                                                    • +
                                                                                    • bnot
                                                                                    • bor
                                                                                    • +
                                                                                    • bsl
                                                                                    • +
                                                                                    • bsr
                                                                                    • +
                                                                                    • bxor
                                                                                    • +
                                                                                    • case
                                                                                    • +
                                                                                    • catch
                                                                                    • cond
                                                                                    • -
                                                                                    • when
                                                                                    • div
                                                                                    • -
                                                                                    • not
                                                                                    • -
                                                                                    • and
                                                                                    • -
                                                                                    • bxor
                                                                                    • -
                                                                                    • of
                                                                                    • end
                                                                                    • -
                                                                                    • let
                                                                                    • -
                                                                                    • xor
                                                                                    • -
                                                                                    • after
                                                                                    • -
                                                                                    • band
                                                                                    • -
                                                                                    • catch
                                                                                    • -
                                                                                    • rem
                                                                                    • +
                                                                                    • fun
                                                                                    • if
                                                                                    • -
                                                                                    • case
                                                                                    • -
                                                                                    • bnot
                                                                                    • -
                                                                                    • receive
                                                                                    • +
                                                                                    • let
                                                                                    • +
                                                                                    • not
                                                                                    • +
                                                                                    • of
                                                                                    • or
                                                                                    • -
                                                                                    • bsl
                                                                                    • +
                                                                                    • orelse
                                                                                    • +
                                                                                    • receive
                                                                                    • +
                                                                                    • rem
                                                                                    • try
                                                                                    • -
                                                                                    • begin
                                                                                    • -
                                                                                    • andalso
                                                                                    • -
                                                                                    • fun
                                                                                    • +
                                                                                    • when
                                                                                    • +
                                                                                    • xor
                                                                                    diff --git a/docs/generators/erlang-proper.md b/docs/generators/erlang-proper.md index 9aa6ce7834b5..6d48712bdc6a 100644 --- a/docs/generators/erlang-proper.md +++ b/docs/generators/erlang-proper.md @@ -6,28 +6,28 @@ sidebar_label: erlang-proper | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |packageName|Erlang application name (convention: lowercase).| |openapi| -|packageName|Erlang application version| |1.0.0| +|packageVersion|Erlang application version| |1.0.0| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -42,31 +42,31 @@ sidebar_label: erlang-proper ## RESERVED WORDS -
                                                                                    • bsr
                                                                                    • -
                                                                                    • orelse
                                                                                    • +
                                                                                      • after
                                                                                      • +
                                                                                      • and
                                                                                      • +
                                                                                      • andalso
                                                                                      • +
                                                                                      • band
                                                                                      • +
                                                                                      • begin
                                                                                      • +
                                                                                      • bnot
                                                                                      • bor
                                                                                      • +
                                                                                      • bsl
                                                                                      • +
                                                                                      • bsr
                                                                                      • +
                                                                                      • bxor
                                                                                      • +
                                                                                      • case
                                                                                      • +
                                                                                      • catch
                                                                                      • cond
                                                                                      • -
                                                                                      • when
                                                                                      • div
                                                                                      • -
                                                                                      • not
                                                                                      • -
                                                                                      • and
                                                                                      • -
                                                                                      • bxor
                                                                                      • -
                                                                                      • of
                                                                                      • end
                                                                                      • -
                                                                                      • let
                                                                                      • -
                                                                                      • xor
                                                                                      • -
                                                                                      • after
                                                                                      • -
                                                                                      • band
                                                                                      • -
                                                                                      • catch
                                                                                      • -
                                                                                      • rem
                                                                                      • +
                                                                                      • fun
                                                                                      • if
                                                                                      • -
                                                                                      • case
                                                                                      • -
                                                                                      • bnot
                                                                                      • -
                                                                                      • receive
                                                                                      • +
                                                                                      • let
                                                                                      • +
                                                                                      • not
                                                                                      • +
                                                                                      • of
                                                                                      • or
                                                                                      • -
                                                                                      • bsl
                                                                                      • +
                                                                                      • orelse
                                                                                      • +
                                                                                      • receive
                                                                                      • +
                                                                                      • rem
                                                                                      • try
                                                                                      • -
                                                                                      • begin
                                                                                      • -
                                                                                      • andalso
                                                                                      • -
                                                                                      • fun
                                                                                      • +
                                                                                      • when
                                                                                      • +
                                                                                      • xor
                                                                                      diff --git a/docs/generators/erlang-server.md b/docs/generators/erlang-server.md index b63b6f2a502e..8db2184f0d9d 100644 --- a/docs/generators/erlang-server.md +++ b/docs/generators/erlang-server.md @@ -5,29 +5,29 @@ sidebar_label: erlang-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|Erlang package name (convention: lowercase).| |openapi| |openAPISpecName|Openapi Spec Name.| |openapi| +|packageName|Erlang package name (convention: lowercase).| |openapi| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -42,31 +42,31 @@ sidebar_label: erlang-server ## RESERVED WORDS -
                                                                                      • bsr
                                                                                      • -
                                                                                      • orelse
                                                                                      • +
                                                                                        • after
                                                                                        • +
                                                                                        • and
                                                                                        • +
                                                                                        • andalso
                                                                                        • +
                                                                                        • band
                                                                                        • +
                                                                                        • begin
                                                                                        • +
                                                                                        • bnot
                                                                                        • bor
                                                                                        • +
                                                                                        • bsl
                                                                                        • +
                                                                                        • bsr
                                                                                        • +
                                                                                        • bxor
                                                                                        • +
                                                                                        • case
                                                                                        • +
                                                                                        • catch
                                                                                        • cond
                                                                                        • -
                                                                                        • when
                                                                                        • div
                                                                                        • -
                                                                                        • not
                                                                                        • -
                                                                                        • and
                                                                                        • -
                                                                                        • bxor
                                                                                        • -
                                                                                        • of
                                                                                        • end
                                                                                        • -
                                                                                        • let
                                                                                        • -
                                                                                        • xor
                                                                                        • -
                                                                                        • after
                                                                                        • -
                                                                                        • band
                                                                                        • -
                                                                                        • catch
                                                                                        • -
                                                                                        • rem
                                                                                        • +
                                                                                        • fun
                                                                                        • if
                                                                                        • -
                                                                                        • case
                                                                                        • -
                                                                                        • bnot
                                                                                        • -
                                                                                        • receive
                                                                                        • +
                                                                                        • let
                                                                                        • +
                                                                                        • not
                                                                                        • +
                                                                                        • of
                                                                                        • or
                                                                                        • -
                                                                                        • bsl
                                                                                        • +
                                                                                        • orelse
                                                                                        • +
                                                                                        • receive
                                                                                        • +
                                                                                        • rem
                                                                                        • try
                                                                                        • -
                                                                                        • begin
                                                                                        • -
                                                                                        • andalso
                                                                                        • -
                                                                                        • fun
                                                                                        • +
                                                                                        • when
                                                                                        • +
                                                                                        • xor
                                                                                        diff --git a/docs/generators/flash.md b/docs/generators/flash.md index aeedd28652fc..5d6fd829b168 100644 --- a/docs/generators/flash.md +++ b/docs/generators/flash.md @@ -5,9 +5,9 @@ sidebar_label: flash | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|invokerPackage|root package for generated code| |null| |packageName|flash package name (convention: package.name)| |org.openapitools| |packageVersion|flash package version| |1.0.0| -|invokerPackage|root package for generated code| |null| |sourceFolder|source folder for generated code. e.g. flash| |null| ## IMPORT MAPPING @@ -26,44 +26,44 @@ sidebar_label: flash ## LANGUAGE PRIMITIVES
                                                                                        • Array
                                                                                        • +
                                                                                        • Boolean
                                                                                        • +
                                                                                        • Date
                                                                                        • Dictionary
                                                                                        • Number
                                                                                        • String
                                                                                        • -
                                                                                        • Boolean
                                                                                        • -
                                                                                        • Date
                                                                                        ## RESERVED WORDS -
                                                                                        • for
                                                                                        • -
                                                                                        • lt
                                                                                        • -
                                                                                        • onclipevent
                                                                                        • -
                                                                                        • do
                                                                                        • -
                                                                                        • while
                                                                                        • -
                                                                                        • delete
                                                                                        • -
                                                                                        • not
                                                                                        • +
                                                                                          • add
                                                                                          • and
                                                                                          • +
                                                                                          • break
                                                                                          • continue
                                                                                          • +
                                                                                          • delete
                                                                                          • +
                                                                                          • do
                                                                                          • else
                                                                                          • +
                                                                                          • eq
                                                                                          • +
                                                                                          • for
                                                                                          • function
                                                                                          • -
                                                                                          • if
                                                                                          • ge
                                                                                          • -
                                                                                          • typeof
                                                                                          • -
                                                                                          • on
                                                                                          • -
                                                                                          • add
                                                                                          • -
                                                                                          • new
                                                                                          • -
                                                                                          • void
                                                                                          • -
                                                                                          • or
                                                                                          • +
                                                                                          • gt
                                                                                          • +
                                                                                          • if
                                                                                          • ifframeloaded
                                                                                          • -
                                                                                          • break
                                                                                          • in
                                                                                          • -
                                                                                          • var
                                                                                          • +
                                                                                          • le
                                                                                          • +
                                                                                          • lt
                                                                                          • +
                                                                                          • ne
                                                                                          • +
                                                                                          • new
                                                                                          • +
                                                                                          • not
                                                                                          • +
                                                                                          • on
                                                                                          • +
                                                                                          • onclipevent
                                                                                          • +
                                                                                          • or
                                                                                          • +
                                                                                          • return
                                                                                          • telltarget
                                                                                          • this
                                                                                          • -
                                                                                          • eq
                                                                                          • -
                                                                                          • gt
                                                                                          • +
                                                                                          • typeof
                                                                                          • +
                                                                                          • var
                                                                                          • +
                                                                                          • void
                                                                                          • +
                                                                                          • while
                                                                                          • with
                                                                                          • -
                                                                                          • ne
                                                                                          • -
                                                                                          • le
                                                                                          • -
                                                                                          • return
                                                                                          diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index c233d8176088..389c94b13388 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -5,19 +5,19 @@ sidebar_label: fsharp-functions | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|licenseUrl|The URL of the license| |http://localhost| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |licenseName|The name of the license| |NoLicense| -|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| +|licenseUrl|The URL of the license| |http://localhost| |packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| -|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| +|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| +|packageGuid|The GUID that will be associated with the C# project| |null| |packageName|F# module name (convention: Title.Case).| |OpenAPI| +|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| |packageVersion|F# package version.| |1.0.0| -|packageGuid|The GUID that will be associated with the C# project| |null| +|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| |OpenAPI/src| ## IMPORT MAPPING @@ -38,150 +38,150 @@ sidebar_label: fsharp-functions ## LANGUAGE PRIMITIVES -
                                                                                          • Dictionary
                                                                                          • -
                                                                                          • string
                                                                                          • -
                                                                                          • bool
                                                                                          • -
                                                                                          • String
                                                                                          • -
                                                                                          • System.IO.Stream
                                                                                          • -
                                                                                          • float
                                                                                          • +
                                                                                            • Collection
                                                                                            • +
                                                                                            • DataTimeOffset
                                                                                            • DateTime
                                                                                            • -
                                                                                            • int64
                                                                                            • +
                                                                                            • Dictionary
                                                                                            • +
                                                                                            • Double
                                                                                            • +
                                                                                            • ICollection
                                                                                            • Int32
                                                                                            • -
                                                                                            • DataTimeOffset
                                                                                            • -
                                                                                            • dict
                                                                                            • +
                                                                                            • Int64
                                                                                            • List
                                                                                            • -
                                                                                            • unativeint
                                                                                            • -
                                                                                            • uint32
                                                                                            • -
                                                                                            • uint16
                                                                                            • -
                                                                                            • seq
                                                                                            • -
                                                                                            • nativeint
                                                                                            • +
                                                                                            • String
                                                                                            • +
                                                                                            • System.IO.Stream
                                                                                            • +
                                                                                            • bool
                                                                                            • +
                                                                                            • byte[]
                                                                                            • +
                                                                                            • char
                                                                                            • +
                                                                                            • decimal
                                                                                            • +
                                                                                            • dict
                                                                                            • double
                                                                                            • +
                                                                                            • float
                                                                                            • float32
                                                                                            • -
                                                                                            • list
                                                                                            • -
                                                                                            • Double
                                                                                            • int
                                                                                            • int16
                                                                                            • -
                                                                                            • byte[]
                                                                                            • -
                                                                                            • single
                                                                                            • -
                                                                                            • Int64
                                                                                            • +
                                                                                            • int64
                                                                                            • +
                                                                                            • list
                                                                                            • +
                                                                                            • nativeint
                                                                                            • obj
                                                                                            • -
                                                                                            • char
                                                                                            • -
                                                                                            • ICollection
                                                                                            • -
                                                                                            • Collection
                                                                                            • +
                                                                                            • seq
                                                                                            • +
                                                                                            • single
                                                                                            • +
                                                                                            • string
                                                                                            • +
                                                                                            • uint16
                                                                                            • +
                                                                                            • uint32
                                                                                            • uint64
                                                                                            • -
                                                                                            • decimal
                                                                                            • +
                                                                                            • unativeint
                                                                                            ## RESERVED WORDS -
                                                                                            • exception
                                                                                            • -
                                                                                            • struct
                                                                                            • -
                                                                                            • select
                                                                                            • -
                                                                                            • type
                                                                                            • -
                                                                                            • when
                                                                                            • -
                                                                                            • localVarQueryParams
                                                                                            • -
                                                                                            • else
                                                                                            • -
                                                                                            • mutable
                                                                                            • -
                                                                                            • lock
                                                                                            • -
                                                                                            • let
                                                                                            • -
                                                                                            • localVarPathParams
                                                                                            • -
                                                                                            • catch
                                                                                            • -
                                                                                            • if
                                                                                            • -
                                                                                            • case
                                                                                            • -
                                                                                            • val
                                                                                            • -
                                                                                            • localVarHttpHeaderAccepts
                                                                                            • -
                                                                                            • localVarPostBody
                                                                                            • -
                                                                                            • in
                                                                                            • +
                                                                                              • abstract
                                                                                              • +
                                                                                              • and
                                                                                              • +
                                                                                              • as
                                                                                              • +
                                                                                              • assert
                                                                                              • +
                                                                                              • async
                                                                                              • +
                                                                                              • await
                                                                                              • +
                                                                                              • base
                                                                                              • +
                                                                                              • begin
                                                                                              • +
                                                                                              • bool
                                                                                              • +
                                                                                              • break
                                                                                              • byte
                                                                                              • +
                                                                                              • case
                                                                                              • +
                                                                                              • catch
                                                                                              • +
                                                                                              • char
                                                                                              • +
                                                                                              • checked
                                                                                              • +
                                                                                              • class
                                                                                              • +
                                                                                              • const
                                                                                              • +
                                                                                              • continue
                                                                                              • +
                                                                                              • decimal
                                                                                              • +
                                                                                              • default
                                                                                              • +
                                                                                              • delegate
                                                                                              • +
                                                                                              • do
                                                                                              • +
                                                                                              • done
                                                                                              • double
                                                                                              • -
                                                                                              • module
                                                                                              • -
                                                                                              • is
                                                                                              • +
                                                                                              • downcast
                                                                                              • +
                                                                                              • downto
                                                                                              • +
                                                                                              • dynamic
                                                                                              • elif
                                                                                              • -
                                                                                              • then
                                                                                              • -
                                                                                              • params
                                                                                              • +
                                                                                              • else
                                                                                              • +
                                                                                              • end
                                                                                              • enum
                                                                                              • +
                                                                                              • event
                                                                                              • +
                                                                                              • exception
                                                                                              • explicit
                                                                                              • -
                                                                                              • as
                                                                                              • -
                                                                                              • begin
                                                                                              • +
                                                                                              • extern
                                                                                              • +
                                                                                              • false
                                                                                              • +
                                                                                              • finally
                                                                                              • +
                                                                                              • fixed
                                                                                              • +
                                                                                              • float
                                                                                              • +
                                                                                              • for
                                                                                              • +
                                                                                              • foreach
                                                                                              • +
                                                                                              • fun
                                                                                              • +
                                                                                              • function
                                                                                              • +
                                                                                              • if
                                                                                              • +
                                                                                              • in
                                                                                              • +
                                                                                              • inherit
                                                                                              • +
                                                                                              • inline
                                                                                              • +
                                                                                              • int
                                                                                              • +
                                                                                              • interface
                                                                                              • internal
                                                                                              • -
                                                                                              • yield!
                                                                                              • +
                                                                                              • is
                                                                                              • lazy
                                                                                              • -
                                                                                              • localVarHttpHeaderAccept
                                                                                              • -
                                                                                              • use!
                                                                                              • -
                                                                                              • delegate
                                                                                              • -
                                                                                              • default
                                                                                              • -
                                                                                              • localVarHttpContentTypes
                                                                                              • -
                                                                                              • localVarHttpContentType
                                                                                              • +
                                                                                              • let
                                                                                              • let!
                                                                                              • -
                                                                                              • assert
                                                                                              • -
                                                                                              • yield
                                                                                              • -
                                                                                              • member
                                                                                              • -
                                                                                              • override
                                                                                              • -
                                                                                              • event
                                                                                              • -
                                                                                              • break
                                                                                              • -
                                                                                              • downto
                                                                                              • -
                                                                                              • abstract
                                                                                              • -
                                                                                              • match!
                                                                                              • -
                                                                                              • char
                                                                                              • localVarFileParams
                                                                                              • -
                                                                                              • to
                                                                                              • -
                                                                                              • fun
                                                                                              • +
                                                                                              • localVarFormParams
                                                                                              • +
                                                                                              • localVarHeaderParams
                                                                                              • +
                                                                                              • localVarHttpContentType
                                                                                              • +
                                                                                              • localVarHttpContentTypes
                                                                                              • +
                                                                                              • localVarHttpHeaderAccept
                                                                                              • +
                                                                                              • localVarHttpHeaderAccepts
                                                                                              • +
                                                                                              • localVarPath
                                                                                              • +
                                                                                              • localVarPathParams
                                                                                              • +
                                                                                              • localVarPostBody
                                                                                              • +
                                                                                              • localVarQueryParams
                                                                                              • +
                                                                                              • localVarResponse
                                                                                              • +
                                                                                              • localVarStatusCode
                                                                                              • +
                                                                                              • lock
                                                                                              • +
                                                                                              • match
                                                                                              • +
                                                                                              • match!
                                                                                              • +
                                                                                              • member
                                                                                              • +
                                                                                              • module
                                                                                              • +
                                                                                              • mutable
                                                                                              • +
                                                                                              • namespace
                                                                                              • +
                                                                                              • new
                                                                                              • +
                                                                                              • not
                                                                                              • +
                                                                                              • null
                                                                                              • +
                                                                                              • of
                                                                                              • open
                                                                                              • +
                                                                                              • option
                                                                                              • +
                                                                                              • or
                                                                                              • +
                                                                                              • override
                                                                                              • +
                                                                                              • params
                                                                                              • +
                                                                                              • private
                                                                                              • +
                                                                                              • public
                                                                                              • +
                                                                                              • raise
                                                                                              • +
                                                                                              • rec
                                                                                              • return
                                                                                              • -
                                                                                              • use
                                                                                              • return!
                                                                                              • -
                                                                                              • extern
                                                                                              • -
                                                                                              • do
                                                                                              • -
                                                                                              • float
                                                                                              • -
                                                                                              • while
                                                                                              • -
                                                                                              • rec
                                                                                              • -
                                                                                              • continue
                                                                                              • -
                                                                                              • function
                                                                                              • -
                                                                                              • raise
                                                                                              • -
                                                                                              • checked
                                                                                              • -
                                                                                              • dynamic
                                                                                              • -
                                                                                              • new
                                                                                              • -
                                                                                              • static
                                                                                              • -
                                                                                              • void
                                                                                              • -
                                                                                              • upcast
                                                                                              • -
                                                                                              • localVarResponse
                                                                                              • sealed
                                                                                              • -
                                                                                              • finally
                                                                                              • -
                                                                                              • done
                                                                                              • -
                                                                                              • null
                                                                                              • -
                                                                                              • localVarPath
                                                                                              • +
                                                                                              • select
                                                                                              • +
                                                                                              • static
                                                                                              • +
                                                                                              • string
                                                                                              • +
                                                                                              • struct
                                                                                              • +
                                                                                              • then
                                                                                              • +
                                                                                              • to
                                                                                              • true
                                                                                              • -
                                                                                              • fixed
                                                                                              • try
                                                                                              • -
                                                                                              • decimal
                                                                                              • -
                                                                                              • option
                                                                                              • -
                                                                                              • private
                                                                                              • -
                                                                                              • bool
                                                                                              • -
                                                                                              • const
                                                                                              • -
                                                                                              • string
                                                                                              • -
                                                                                              • for
                                                                                              • -
                                                                                              • interface
                                                                                              • -
                                                                                              • foreach
                                                                                              • -
                                                                                              • not
                                                                                              • -
                                                                                              • public
                                                                                              • -
                                                                                              • localVarStatusCode
                                                                                              • -
                                                                                              • and
                                                                                              • -
                                                                                              • of
                                                                                              • -
                                                                                              • await
                                                                                              • -
                                                                                              • end
                                                                                              • -
                                                                                              • class
                                                                                              • -
                                                                                              • localVarFormParams
                                                                                              • -
                                                                                              • or
                                                                                              • -
                                                                                              • false
                                                                                              • -
                                                                                              • match
                                                                                              • +
                                                                                              • type
                                                                                              • +
                                                                                              • upcast
                                                                                              • +
                                                                                              • use
                                                                                              • +
                                                                                              • use!
                                                                                              • +
                                                                                              • val
                                                                                              • +
                                                                                              • void
                                                                                              • volatile
                                                                                              • -
                                                                                              • int
                                                                                              • -
                                                                                              • async
                                                                                              • +
                                                                                              • when
                                                                                              • +
                                                                                              • while
                                                                                              • with
                                                                                              • -
                                                                                              • localVarHeaderParams
                                                                                              • -
                                                                                              • inline
                                                                                              • -
                                                                                              • downcast
                                                                                              • -
                                                                                              • inherit
                                                                                              • -
                                                                                              • namespace
                                                                                              • -
                                                                                              • base
                                                                                              • +
                                                                                              • yield
                                                                                              • +
                                                                                              • yield!
                                                                                              diff --git a/docs/generators/fsharp-giraffe-server.md b/docs/generators/fsharp-giraffe-server.md index f042e6b9efe6..d05383c75dec 100644 --- a/docs/generators/fsharp-giraffe-server.md +++ b/docs/generators/fsharp-giraffe-server.md @@ -5,22 +5,22 @@ sidebar_label: fsharp-giraffe-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|licenseUrl|The URL of the license| |http://localhost| +|buildTarget|Target the build for a program or library.| |program| +|generateBody|Generates method body.| |true| |licenseName|The name of the license| |NoLicense| -|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| +|licenseUrl|The URL of the license| |http://localhost| |packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| -|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| +|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| +|packageGuid|The GUID that will be associated with the C# project| |null| |packageName|F# module name (convention: Title.Case).| |OpenAPI| +|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| |packageVersion|F# package version.| |1.0.0| -|packageGuid|The GUID that will be associated with the C# project| |null| -|sourceFolder|source folder for generated code| |OpenAPI/src| +|returnICollection|Return ICollection<T> instead of the concrete type.| |false| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| +|sourceFolder|source folder for generated code| |OpenAPI/src| |useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| +|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| |useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |false| -|generateBody|Generates method body.| |true| -|buildTarget|Target the build for a program or library.| |program| ## IMPORT MAPPING @@ -40,150 +40,150 @@ sidebar_label: fsharp-giraffe-server ## LANGUAGE PRIMITIVES -
                                                                                              • Dictionary
                                                                                              • -
                                                                                              • string
                                                                                              • -
                                                                                              • bool
                                                                                              • -
                                                                                              • String
                                                                                              • -
                                                                                              • System.IO.Stream
                                                                                              • -
                                                                                              • float
                                                                                              • +
                                                                                                • Collection
                                                                                                • +
                                                                                                • DataTimeOffset
                                                                                                • DateTime
                                                                                                • -
                                                                                                • int64
                                                                                                • +
                                                                                                • Dictionary
                                                                                                • +
                                                                                                • Double
                                                                                                • +
                                                                                                • ICollection
                                                                                                • Int32
                                                                                                • -
                                                                                                • DataTimeOffset
                                                                                                • -
                                                                                                • dict
                                                                                                • +
                                                                                                • Int64
                                                                                                • List
                                                                                                • -
                                                                                                • unativeint
                                                                                                • -
                                                                                                • uint32
                                                                                                • -
                                                                                                • uint16
                                                                                                • -
                                                                                                • seq
                                                                                                • -
                                                                                                • nativeint
                                                                                                • +
                                                                                                • String
                                                                                                • +
                                                                                                • System.IO.Stream
                                                                                                • +
                                                                                                • bool
                                                                                                • +
                                                                                                • byte[]
                                                                                                • +
                                                                                                • char
                                                                                                • +
                                                                                                • decimal
                                                                                                • +
                                                                                                • dict
                                                                                                • double
                                                                                                • +
                                                                                                • float
                                                                                                • float32
                                                                                                • -
                                                                                                • list
                                                                                                • -
                                                                                                • Double
                                                                                                • int
                                                                                                • int16
                                                                                                • -
                                                                                                • byte[]
                                                                                                • -
                                                                                                • single
                                                                                                • -
                                                                                                • Int64
                                                                                                • +
                                                                                                • int64
                                                                                                • +
                                                                                                • list
                                                                                                • +
                                                                                                • nativeint
                                                                                                • obj
                                                                                                • -
                                                                                                • char
                                                                                                • -
                                                                                                • ICollection
                                                                                                • -
                                                                                                • Collection
                                                                                                • +
                                                                                                • seq
                                                                                                • +
                                                                                                • single
                                                                                                • +
                                                                                                • string
                                                                                                • +
                                                                                                • uint16
                                                                                                • +
                                                                                                • uint32
                                                                                                • uint64
                                                                                                • -
                                                                                                • decimal
                                                                                                • +
                                                                                                • unativeint
                                                                                                ## RESERVED WORDS -
                                                                                                • exception
                                                                                                • -
                                                                                                • struct
                                                                                                • -
                                                                                                • select
                                                                                                • -
                                                                                                • type
                                                                                                • -
                                                                                                • when
                                                                                                • -
                                                                                                • localVarQueryParams
                                                                                                • -
                                                                                                • else
                                                                                                • -
                                                                                                • mutable
                                                                                                • -
                                                                                                • lock
                                                                                                • -
                                                                                                • let
                                                                                                • -
                                                                                                • localVarPathParams
                                                                                                • -
                                                                                                • catch
                                                                                                • -
                                                                                                • if
                                                                                                • -
                                                                                                • case
                                                                                                • -
                                                                                                • val
                                                                                                • -
                                                                                                • localVarHttpHeaderAccepts
                                                                                                • -
                                                                                                • localVarPostBody
                                                                                                • -
                                                                                                • in
                                                                                                • +
                                                                                                  • abstract
                                                                                                  • +
                                                                                                  • and
                                                                                                  • +
                                                                                                  • as
                                                                                                  • +
                                                                                                  • assert
                                                                                                  • +
                                                                                                  • async
                                                                                                  • +
                                                                                                  • await
                                                                                                  • +
                                                                                                  • base
                                                                                                  • +
                                                                                                  • begin
                                                                                                  • +
                                                                                                  • bool
                                                                                                  • +
                                                                                                  • break
                                                                                                  • byte
                                                                                                  • +
                                                                                                  • case
                                                                                                  • +
                                                                                                  • catch
                                                                                                  • +
                                                                                                  • char
                                                                                                  • +
                                                                                                  • checked
                                                                                                  • +
                                                                                                  • class
                                                                                                  • +
                                                                                                  • const
                                                                                                  • +
                                                                                                  • continue
                                                                                                  • +
                                                                                                  • decimal
                                                                                                  • +
                                                                                                  • default
                                                                                                  • +
                                                                                                  • delegate
                                                                                                  • +
                                                                                                  • do
                                                                                                  • +
                                                                                                  • done
                                                                                                  • double
                                                                                                  • -
                                                                                                  • module
                                                                                                  • -
                                                                                                  • is
                                                                                                  • +
                                                                                                  • downcast
                                                                                                  • +
                                                                                                  • downto
                                                                                                  • +
                                                                                                  • dynamic
                                                                                                  • elif
                                                                                                  • -
                                                                                                  • then
                                                                                                  • -
                                                                                                  • params
                                                                                                  • +
                                                                                                  • else
                                                                                                  • +
                                                                                                  • end
                                                                                                  • enum
                                                                                                  • +
                                                                                                  • event
                                                                                                  • +
                                                                                                  • exception
                                                                                                  • explicit
                                                                                                  • -
                                                                                                  • as
                                                                                                  • -
                                                                                                  • begin
                                                                                                  • +
                                                                                                  • extern
                                                                                                  • +
                                                                                                  • false
                                                                                                  • +
                                                                                                  • finally
                                                                                                  • +
                                                                                                  • fixed
                                                                                                  • +
                                                                                                  • float
                                                                                                  • +
                                                                                                  • for
                                                                                                  • +
                                                                                                  • foreach
                                                                                                  • +
                                                                                                  • fun
                                                                                                  • +
                                                                                                  • function
                                                                                                  • +
                                                                                                  • if
                                                                                                  • +
                                                                                                  • in
                                                                                                  • +
                                                                                                  • inherit
                                                                                                  • +
                                                                                                  • inline
                                                                                                  • +
                                                                                                  • int
                                                                                                  • +
                                                                                                  • interface
                                                                                                  • internal
                                                                                                  • -
                                                                                                  • yield!
                                                                                                  • +
                                                                                                  • is
                                                                                                  • lazy
                                                                                                  • -
                                                                                                  • localVarHttpHeaderAccept
                                                                                                  • -
                                                                                                  • use!
                                                                                                  • -
                                                                                                  • delegate
                                                                                                  • -
                                                                                                  • default
                                                                                                  • -
                                                                                                  • localVarHttpContentTypes
                                                                                                  • -
                                                                                                  • localVarHttpContentType
                                                                                                  • +
                                                                                                  • let
                                                                                                  • let!
                                                                                                  • -
                                                                                                  • assert
                                                                                                  • -
                                                                                                  • yield
                                                                                                  • -
                                                                                                  • member
                                                                                                  • -
                                                                                                  • override
                                                                                                  • -
                                                                                                  • event
                                                                                                  • -
                                                                                                  • break
                                                                                                  • -
                                                                                                  • downto
                                                                                                  • -
                                                                                                  • abstract
                                                                                                  • -
                                                                                                  • match!
                                                                                                  • -
                                                                                                  • char
                                                                                                  • localVarFileParams
                                                                                                  • -
                                                                                                  • to
                                                                                                  • -
                                                                                                  • fun
                                                                                                  • +
                                                                                                  • localVarFormParams
                                                                                                  • +
                                                                                                  • localVarHeaderParams
                                                                                                  • +
                                                                                                  • localVarHttpContentType
                                                                                                  • +
                                                                                                  • localVarHttpContentTypes
                                                                                                  • +
                                                                                                  • localVarHttpHeaderAccept
                                                                                                  • +
                                                                                                  • localVarHttpHeaderAccepts
                                                                                                  • +
                                                                                                  • localVarPath
                                                                                                  • +
                                                                                                  • localVarPathParams
                                                                                                  • +
                                                                                                  • localVarPostBody
                                                                                                  • +
                                                                                                  • localVarQueryParams
                                                                                                  • +
                                                                                                  • localVarResponse
                                                                                                  • +
                                                                                                  • localVarStatusCode
                                                                                                  • +
                                                                                                  • lock
                                                                                                  • +
                                                                                                  • match
                                                                                                  • +
                                                                                                  • match!
                                                                                                  • +
                                                                                                  • member
                                                                                                  • +
                                                                                                  • module
                                                                                                  • +
                                                                                                  • mutable
                                                                                                  • +
                                                                                                  • namespace
                                                                                                  • +
                                                                                                  • new
                                                                                                  • +
                                                                                                  • not
                                                                                                  • +
                                                                                                  • null
                                                                                                  • +
                                                                                                  • of
                                                                                                  • open
                                                                                                  • +
                                                                                                  • option
                                                                                                  • +
                                                                                                  • or
                                                                                                  • +
                                                                                                  • override
                                                                                                  • +
                                                                                                  • params
                                                                                                  • +
                                                                                                  • private
                                                                                                  • +
                                                                                                  • public
                                                                                                  • +
                                                                                                  • raise
                                                                                                  • +
                                                                                                  • rec
                                                                                                  • return
                                                                                                  • -
                                                                                                  • use
                                                                                                  • return!
                                                                                                  • -
                                                                                                  • extern
                                                                                                  • -
                                                                                                  • do
                                                                                                  • -
                                                                                                  • float
                                                                                                  • -
                                                                                                  • while
                                                                                                  • -
                                                                                                  • rec
                                                                                                  • -
                                                                                                  • continue
                                                                                                  • -
                                                                                                  • function
                                                                                                  • -
                                                                                                  • raise
                                                                                                  • -
                                                                                                  • checked
                                                                                                  • -
                                                                                                  • dynamic
                                                                                                  • -
                                                                                                  • new
                                                                                                  • -
                                                                                                  • static
                                                                                                  • -
                                                                                                  • void
                                                                                                  • -
                                                                                                  • upcast
                                                                                                  • -
                                                                                                  • localVarResponse
                                                                                                  • sealed
                                                                                                  • -
                                                                                                  • finally
                                                                                                  • -
                                                                                                  • done
                                                                                                  • -
                                                                                                  • null
                                                                                                  • -
                                                                                                  • localVarPath
                                                                                                  • +
                                                                                                  • select
                                                                                                  • +
                                                                                                  • static
                                                                                                  • +
                                                                                                  • string
                                                                                                  • +
                                                                                                  • struct
                                                                                                  • +
                                                                                                  • then
                                                                                                  • +
                                                                                                  • to
                                                                                                  • true
                                                                                                  • -
                                                                                                  • fixed
                                                                                                  • try
                                                                                                  • -
                                                                                                  • decimal
                                                                                                  • -
                                                                                                  • option
                                                                                                  • -
                                                                                                  • private
                                                                                                  • -
                                                                                                  • bool
                                                                                                  • -
                                                                                                  • const
                                                                                                  • -
                                                                                                  • string
                                                                                                  • -
                                                                                                  • for
                                                                                                  • -
                                                                                                  • interface
                                                                                                  • -
                                                                                                  • foreach
                                                                                                  • -
                                                                                                  • not
                                                                                                  • -
                                                                                                  • public
                                                                                                  • -
                                                                                                  • localVarStatusCode
                                                                                                  • -
                                                                                                  • and
                                                                                                  • -
                                                                                                  • of
                                                                                                  • -
                                                                                                  • await
                                                                                                  • -
                                                                                                  • end
                                                                                                  • -
                                                                                                  • class
                                                                                                  • -
                                                                                                  • localVarFormParams
                                                                                                  • -
                                                                                                  • or
                                                                                                  • -
                                                                                                  • false
                                                                                                  • -
                                                                                                  • match
                                                                                                  • +
                                                                                                  • type
                                                                                                  • +
                                                                                                  • upcast
                                                                                                  • +
                                                                                                  • use
                                                                                                  • +
                                                                                                  • use!
                                                                                                  • +
                                                                                                  • val
                                                                                                  • +
                                                                                                  • void
                                                                                                  • volatile
                                                                                                  • -
                                                                                                  • int
                                                                                                  • -
                                                                                                  • async
                                                                                                  • +
                                                                                                  • when
                                                                                                  • +
                                                                                                  • while
                                                                                                  • with
                                                                                                  • -
                                                                                                  • localVarHeaderParams
                                                                                                  • -
                                                                                                  • inline
                                                                                                  • -
                                                                                                  • downcast
                                                                                                  • -
                                                                                                  • inherit
                                                                                                  • -
                                                                                                  • namespace
                                                                                                  • -
                                                                                                  • base
                                                                                                  • +
                                                                                                  • yield
                                                                                                  • +
                                                                                                  • yield!
                                                                                                  diff --git a/docs/generators/fsharp-giraffe.md b/docs/generators/fsharp-giraffe.md deleted file mode 100644 index 473781b7c520..000000000000 --- a/docs/generators/fsharp-giraffe.md +++ /dev/null @@ -1,25 +0,0 @@ - ---- -id: generator-opts-server-fsharp-giraffe -title: Config Options for fsharp-giraffe -sidebar_label: fsharp-giraffe ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|licenseUrl|The URL of the license| |http://localhost| -|licenseName|The name of the license| |NoLicense| -|packageCopyright|Specifies an AssemblyCopyright for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |No Copyright| -|packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| -|packageTitle|Specifies an AssemblyTitle for the .NET Framework global assembly attributes stored in the AssemblyInfo file.| |OpenAPI Library| -|packageName|F# module name (convention: Title.Case).| |OpenAPI| -|packageVersion|F# package version.| |1.0.0| -|packageGuid|The GUID that will be associated with the C# project| |null| -|sourceFolder|source folder for generated code| |OpenAPI/src| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false| -|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false| -|returnICollection|Return ICollection<T> instead of the concrete type.| |false| -|useSwashbuckle|Uses the Swashbuckle.AspNetCore NuGet package for documentation.| |false| -|generateBody|Generates method body.| |true| -|buildTarget|Target the build for a program or library.| |program| diff --git a/docs/generators/go-experimental.md b/docs/generators/go-experimental.md index 15d74272f00a..6099220d652d 100644 --- a/docs/generators/go-experimental.md +++ b/docs/generators/go-experimental.md @@ -5,16 +5,16 @@ sidebar_label: go-experimental | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|Go package name (convention: lowercase).| |openapi| -|packageVersion|Go package version.| |1.0.0| +|enumClassPrefix|Prefix enum with class name| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |isGoSubmodule|whether the generated Go module is a submodule| |false| -|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|enumClassPrefix|Prefix enum with class name| |false| +|packageName|Go package name (convention: lowercase).| |openapi| +|packageVersion|Go package version.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| |withAWSV4Signature|whether to include AWS v4 signature support| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING @@ -30,68 +30,68 @@ sidebar_label: go-experimental ## LANGUAGE PRIMITIVES -
                                                                                                  • string
                                                                                                  • -
                                                                                                  • bool
                                                                                                  • +
                                                                                                    • bool
                                                                                                    • byte
                                                                                                    • +
                                                                                                    • complex128
                                                                                                    • +
                                                                                                    • complex64
                                                                                                    • float32
                                                                                                    • float64
                                                                                                    • -
                                                                                                    • uint
                                                                                                    • int
                                                                                                    • -
                                                                                                    • complex64
                                                                                                    • -
                                                                                                    • rune
                                                                                                    • int32
                                                                                                    • int64
                                                                                                    • -
                                                                                                    • complex128
                                                                                                    • -
                                                                                                    • uint64
                                                                                                    • +
                                                                                                    • rune
                                                                                                    • +
                                                                                                    • string
                                                                                                    • +
                                                                                                    • uint
                                                                                                    • uint32
                                                                                                    • +
                                                                                                    • uint64
                                                                                                    ## RESERVED WORDS -
                                                                                                    • struct
                                                                                                    • -
                                                                                                    • defer
                                                                                                    • -
                                                                                                    • select
                                                                                                    • -
                                                                                                    • string
                                                                                                    • -
                                                                                                    • bool
                                                                                                    • -
                                                                                                    • const
                                                                                                    • -
                                                                                                    • import
                                                                                                    • -
                                                                                                    • for
                                                                                                    • -
                                                                                                    • range
                                                                                                    • -
                                                                                                    • float64
                                                                                                    • -
                                                                                                    • interface
                                                                                                    • -
                                                                                                    • type
                                                                                                    • -
                                                                                                    • error
                                                                                                    • +
                                                                                                      • bool
                                                                                                      • +
                                                                                                      • break
                                                                                                      • +
                                                                                                      • byte
                                                                                                      • +
                                                                                                      • case
                                                                                                      • +
                                                                                                      • chan
                                                                                                      • +
                                                                                                      • complex128
                                                                                                      • complex64
                                                                                                      • -
                                                                                                      • rune
                                                                                                      • -
                                                                                                      • switch
                                                                                                      • -
                                                                                                      • nil
                                                                                                      • +
                                                                                                      • const
                                                                                                      • +
                                                                                                      • continue
                                                                                                      • default
                                                                                                      • +
                                                                                                      • defer
                                                                                                      • +
                                                                                                      • else
                                                                                                      • +
                                                                                                      • error
                                                                                                      • +
                                                                                                      • fallthrough
                                                                                                      • +
                                                                                                      • float32
                                                                                                      • +
                                                                                                      • float64
                                                                                                      • +
                                                                                                      • for
                                                                                                      • +
                                                                                                      • func
                                                                                                      • +
                                                                                                      • go
                                                                                                      • goto
                                                                                                      • +
                                                                                                      • if
                                                                                                      • +
                                                                                                      • import
                                                                                                      • +
                                                                                                      • int
                                                                                                      • +
                                                                                                      • int16
                                                                                                      • +
                                                                                                      • int32
                                                                                                      • int64
                                                                                                      • -
                                                                                                      • else
                                                                                                      • -
                                                                                                      • continue
                                                                                                      • int8
                                                                                                      • -
                                                                                                      • uint32
                                                                                                      • -
                                                                                                      • uint16
                                                                                                      • +
                                                                                                      • interface
                                                                                                      • map
                                                                                                      • -
                                                                                                      • if
                                                                                                      • -
                                                                                                      • case
                                                                                                      • +
                                                                                                      • nil
                                                                                                      • package
                                                                                                      • -
                                                                                                      • break
                                                                                                      • -
                                                                                                      • byte
                                                                                                      • -
                                                                                                      • var
                                                                                                      • -
                                                                                                      • go
                                                                                                      • -
                                                                                                      • float32
                                                                                                      • +
                                                                                                      • range
                                                                                                      • +
                                                                                                      • return
                                                                                                      • +
                                                                                                      • rune
                                                                                                      • +
                                                                                                      • select
                                                                                                      • +
                                                                                                      • string
                                                                                                      • +
                                                                                                      • struct
                                                                                                      • +
                                                                                                      • switch
                                                                                                      • +
                                                                                                      • type
                                                                                                      • uint
                                                                                                      • -
                                                                                                      • int
                                                                                                      • -
                                                                                                      • int16
                                                                                                      • -
                                                                                                      • func
                                                                                                      • -
                                                                                                      • int32
                                                                                                      • -
                                                                                                      • complex128
                                                                                                      • +
                                                                                                      • uint16
                                                                                                      • +
                                                                                                      • uint32
                                                                                                      • uint64
                                                                                                      • uint8
                                                                                                      • -
                                                                                                      • chan
                                                                                                      • -
                                                                                                      • fallthrough
                                                                                                      • uintptr
                                                                                                      • -
                                                                                                      • return
                                                                                                      • +
                                                                                                      • var
                                                                                                      diff --git a/docs/generators/go-gin-server.md b/docs/generators/go-gin-server.md index fabf59d8553b..189705f0920f 100644 --- a/docs/generators/go-gin-server.md +++ b/docs/generators/go-gin-server.md @@ -5,9 +5,9 @@ sidebar_label: go-gin-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |packageName|Go package name (convention: lowercase).| |openapi| |packageVersion|Go package version.| |1.0.0| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| ## IMPORT MAPPING @@ -23,68 +23,68 @@ sidebar_label: go-gin-server ## LANGUAGE PRIMITIVES -
                                                                                                      • string
                                                                                                      • -
                                                                                                      • bool
                                                                                                      • +
                                                                                                        • bool
                                                                                                        • byte
                                                                                                        • +
                                                                                                        • complex128
                                                                                                        • +
                                                                                                        • complex64
                                                                                                        • float32
                                                                                                        • float64
                                                                                                        • -
                                                                                                        • uint
                                                                                                        • int
                                                                                                        • -
                                                                                                        • complex64
                                                                                                        • -
                                                                                                        • rune
                                                                                                        • int32
                                                                                                        • int64
                                                                                                        • -
                                                                                                        • complex128
                                                                                                        • -
                                                                                                        • uint64
                                                                                                        • +
                                                                                                        • rune
                                                                                                        • +
                                                                                                        • string
                                                                                                        • +
                                                                                                        • uint
                                                                                                        • uint32
                                                                                                        • +
                                                                                                        • uint64
                                                                                                        ## RESERVED WORDS -
                                                                                                        • struct
                                                                                                        • -
                                                                                                        • defer
                                                                                                        • -
                                                                                                        • select
                                                                                                        • -
                                                                                                        • string
                                                                                                        • -
                                                                                                        • bool
                                                                                                        • -
                                                                                                        • const
                                                                                                        • -
                                                                                                        • import
                                                                                                        • -
                                                                                                        • for
                                                                                                        • -
                                                                                                        • range
                                                                                                        • -
                                                                                                        • float64
                                                                                                        • -
                                                                                                        • interface
                                                                                                        • -
                                                                                                        • type
                                                                                                        • -
                                                                                                        • error
                                                                                                        • +
                                                                                                          • bool
                                                                                                          • +
                                                                                                          • break
                                                                                                          • +
                                                                                                          • byte
                                                                                                          • +
                                                                                                          • case
                                                                                                          • +
                                                                                                          • chan
                                                                                                          • +
                                                                                                          • complex128
                                                                                                          • complex64
                                                                                                          • -
                                                                                                          • rune
                                                                                                          • -
                                                                                                          • switch
                                                                                                          • -
                                                                                                          • nil
                                                                                                          • +
                                                                                                          • const
                                                                                                          • +
                                                                                                          • continue
                                                                                                          • default
                                                                                                          • +
                                                                                                          • defer
                                                                                                          • +
                                                                                                          • else
                                                                                                          • +
                                                                                                          • error
                                                                                                          • +
                                                                                                          • fallthrough
                                                                                                          • +
                                                                                                          • float32
                                                                                                          • +
                                                                                                          • float64
                                                                                                          • +
                                                                                                          • for
                                                                                                          • +
                                                                                                          • func
                                                                                                          • +
                                                                                                          • go
                                                                                                          • goto
                                                                                                          • +
                                                                                                          • if
                                                                                                          • +
                                                                                                          • import
                                                                                                          • +
                                                                                                          • int
                                                                                                          • +
                                                                                                          • int16
                                                                                                          • +
                                                                                                          • int32
                                                                                                          • int64
                                                                                                          • -
                                                                                                          • else
                                                                                                          • -
                                                                                                          • continue
                                                                                                          • int8
                                                                                                          • -
                                                                                                          • uint32
                                                                                                          • -
                                                                                                          • uint16
                                                                                                          • +
                                                                                                          • interface
                                                                                                          • map
                                                                                                          • -
                                                                                                          • if
                                                                                                          • -
                                                                                                          • case
                                                                                                          • +
                                                                                                          • nil
                                                                                                          • package
                                                                                                          • -
                                                                                                          • break
                                                                                                          • -
                                                                                                          • byte
                                                                                                          • -
                                                                                                          • var
                                                                                                          • -
                                                                                                          • go
                                                                                                          • -
                                                                                                          • float32
                                                                                                          • +
                                                                                                          • range
                                                                                                          • +
                                                                                                          • return
                                                                                                          • +
                                                                                                          • rune
                                                                                                          • +
                                                                                                          • select
                                                                                                          • +
                                                                                                          • string
                                                                                                          • +
                                                                                                          • struct
                                                                                                          • +
                                                                                                          • switch
                                                                                                          • +
                                                                                                          • type
                                                                                                          • uint
                                                                                                          • -
                                                                                                          • int
                                                                                                          • -
                                                                                                          • int16
                                                                                                          • -
                                                                                                          • func
                                                                                                          • -
                                                                                                          • int32
                                                                                                          • -
                                                                                                          • complex128
                                                                                                          • +
                                                                                                          • uint16
                                                                                                          • +
                                                                                                          • uint32
                                                                                                          • uint64
                                                                                                          • uint8
                                                                                                          • -
                                                                                                          • chan
                                                                                                          • -
                                                                                                          • fallthrough
                                                                                                          • uintptr
                                                                                                          • -
                                                                                                          • return
                                                                                                          • +
                                                                                                          • var
                                                                                                          diff --git a/docs/generators/go-server.md b/docs/generators/go-server.md index c1bc80844f90..0125db11e995 100644 --- a/docs/generators/go-server.md +++ b/docs/generators/go-server.md @@ -5,12 +5,12 @@ sidebar_label: go-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|featureCORS|Enable Cross-Origin Resource Sharing middleware| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |packageName|Go package name (convention: lowercase).| |openapi| |packageVersion|Go package version.| |1.0.0| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|sourceFolder|source folder for generated code| |go| |serverPort|The network port the generated server binds to| |8080| -|featureCORS|Enable Cross-Origin Resource Sharing middleware| |false| +|sourceFolder|source folder for generated code| |go| ## IMPORT MAPPING @@ -26,68 +26,68 @@ sidebar_label: go-server ## LANGUAGE PRIMITIVES -
                                                                                                          • string
                                                                                                          • -
                                                                                                          • bool
                                                                                                          • +
                                                                                                            • bool
                                                                                                            • byte
                                                                                                            • +
                                                                                                            • complex128
                                                                                                            • +
                                                                                                            • complex64
                                                                                                            • float32
                                                                                                            • float64
                                                                                                            • -
                                                                                                            • uint
                                                                                                            • int
                                                                                                            • -
                                                                                                            • complex64
                                                                                                            • -
                                                                                                            • rune
                                                                                                            • int32
                                                                                                            • int64
                                                                                                            • -
                                                                                                            • complex128
                                                                                                            • -
                                                                                                            • uint64
                                                                                                            • +
                                                                                                            • rune
                                                                                                            • +
                                                                                                            • string
                                                                                                            • +
                                                                                                            • uint
                                                                                                            • uint32
                                                                                                            • +
                                                                                                            • uint64
                                                                                                            ## RESERVED WORDS -
                                                                                                            • struct
                                                                                                            • -
                                                                                                            • defer
                                                                                                            • -
                                                                                                            • select
                                                                                                            • -
                                                                                                            • string
                                                                                                            • -
                                                                                                            • bool
                                                                                                            • -
                                                                                                            • const
                                                                                                            • -
                                                                                                            • import
                                                                                                            • -
                                                                                                            • for
                                                                                                            • -
                                                                                                            • range
                                                                                                            • -
                                                                                                            • float64
                                                                                                            • -
                                                                                                            • interface
                                                                                                            • -
                                                                                                            • type
                                                                                                            • -
                                                                                                            • error
                                                                                                            • +
                                                                                                              • bool
                                                                                                              • +
                                                                                                              • break
                                                                                                              • +
                                                                                                              • byte
                                                                                                              • +
                                                                                                              • case
                                                                                                              • +
                                                                                                              • chan
                                                                                                              • +
                                                                                                              • complex128
                                                                                                              • complex64
                                                                                                              • -
                                                                                                              • rune
                                                                                                              • -
                                                                                                              • switch
                                                                                                              • -
                                                                                                              • nil
                                                                                                              • +
                                                                                                              • const
                                                                                                              • +
                                                                                                              • continue
                                                                                                              • default
                                                                                                              • +
                                                                                                              • defer
                                                                                                              • +
                                                                                                              • else
                                                                                                              • +
                                                                                                              • error
                                                                                                              • +
                                                                                                              • fallthrough
                                                                                                              • +
                                                                                                              • float32
                                                                                                              • +
                                                                                                              • float64
                                                                                                              • +
                                                                                                              • for
                                                                                                              • +
                                                                                                              • func
                                                                                                              • +
                                                                                                              • go
                                                                                                              • goto
                                                                                                              • +
                                                                                                              • if
                                                                                                              • +
                                                                                                              • import
                                                                                                              • +
                                                                                                              • int
                                                                                                              • +
                                                                                                              • int16
                                                                                                              • +
                                                                                                              • int32
                                                                                                              • int64
                                                                                                              • -
                                                                                                              • else
                                                                                                              • -
                                                                                                              • continue
                                                                                                              • int8
                                                                                                              • -
                                                                                                              • uint32
                                                                                                              • -
                                                                                                              • uint16
                                                                                                              • +
                                                                                                              • interface
                                                                                                              • map
                                                                                                              • -
                                                                                                              • if
                                                                                                              • -
                                                                                                              • case
                                                                                                              • +
                                                                                                              • nil
                                                                                                              • package
                                                                                                              • -
                                                                                                              • break
                                                                                                              • -
                                                                                                              • byte
                                                                                                              • -
                                                                                                              • var
                                                                                                              • -
                                                                                                              • go
                                                                                                              • -
                                                                                                              • float32
                                                                                                              • +
                                                                                                              • range
                                                                                                              • +
                                                                                                              • return
                                                                                                              • +
                                                                                                              • rune
                                                                                                              • +
                                                                                                              • select
                                                                                                              • +
                                                                                                              • string
                                                                                                              • +
                                                                                                              • struct
                                                                                                              • +
                                                                                                              • switch
                                                                                                              • +
                                                                                                              • type
                                                                                                              • uint
                                                                                                              • -
                                                                                                              • int
                                                                                                              • -
                                                                                                              • int16
                                                                                                              • -
                                                                                                              • func
                                                                                                              • -
                                                                                                              • int32
                                                                                                              • -
                                                                                                              • complex128
                                                                                                              • +
                                                                                                              • uint16
                                                                                                              • +
                                                                                                              • uint32
                                                                                                              • uint64
                                                                                                              • uint8
                                                                                                              • -
                                                                                                              • chan
                                                                                                              • -
                                                                                                              • fallthrough
                                                                                                              • uintptr
                                                                                                              • -
                                                                                                              • return
                                                                                                              • +
                                                                                                              • var
                                                                                                              diff --git a/docs/generators/go.md b/docs/generators/go.md index c26fb88d2eff..1d8909bbfcdf 100644 --- a/docs/generators/go.md +++ b/docs/generators/go.md @@ -5,16 +5,16 @@ sidebar_label: go | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|Go package name (convention: lowercase).| |openapi| -|packageVersion|Go package version.| |1.0.0| +|enumClassPrefix|Prefix enum with class name| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |isGoSubmodule|whether the generated Go module is a submodule| |false| -|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|enumClassPrefix|Prefix enum with class name| |false| +|packageName|Go package name (convention: lowercase).| |openapi| +|packageVersion|Go package version.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false| |withAWSV4Signature|whether to include AWS v4 signature support| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING @@ -30,68 +30,68 @@ sidebar_label: go ## LANGUAGE PRIMITIVES -
                                                                                                              • string
                                                                                                              • -
                                                                                                              • bool
                                                                                                              • +
                                                                                                                • bool
                                                                                                                • byte
                                                                                                                • +
                                                                                                                • complex128
                                                                                                                • +
                                                                                                                • complex64
                                                                                                                • float32
                                                                                                                • float64
                                                                                                                • -
                                                                                                                • uint
                                                                                                                • int
                                                                                                                • -
                                                                                                                • complex64
                                                                                                                • -
                                                                                                                • rune
                                                                                                                • int32
                                                                                                                • int64
                                                                                                                • -
                                                                                                                • complex128
                                                                                                                • -
                                                                                                                • uint64
                                                                                                                • +
                                                                                                                • rune
                                                                                                                • +
                                                                                                                • string
                                                                                                                • +
                                                                                                                • uint
                                                                                                                • uint32
                                                                                                                • +
                                                                                                                • uint64
                                                                                                                ## RESERVED WORDS -
                                                                                                                • struct
                                                                                                                • -
                                                                                                                • defer
                                                                                                                • -
                                                                                                                • select
                                                                                                                • -
                                                                                                                • string
                                                                                                                • -
                                                                                                                • bool
                                                                                                                • -
                                                                                                                • const
                                                                                                                • -
                                                                                                                • import
                                                                                                                • -
                                                                                                                • for
                                                                                                                • -
                                                                                                                • range
                                                                                                                • -
                                                                                                                • float64
                                                                                                                • -
                                                                                                                • interface
                                                                                                                • -
                                                                                                                • type
                                                                                                                • -
                                                                                                                • error
                                                                                                                • +
                                                                                                                  • bool
                                                                                                                  • +
                                                                                                                  • break
                                                                                                                  • +
                                                                                                                  • byte
                                                                                                                  • +
                                                                                                                  • case
                                                                                                                  • +
                                                                                                                  • chan
                                                                                                                  • +
                                                                                                                  • complex128
                                                                                                                  • complex64
                                                                                                                  • -
                                                                                                                  • rune
                                                                                                                  • -
                                                                                                                  • switch
                                                                                                                  • -
                                                                                                                  • nil
                                                                                                                  • +
                                                                                                                  • const
                                                                                                                  • +
                                                                                                                  • continue
                                                                                                                  • default
                                                                                                                  • +
                                                                                                                  • defer
                                                                                                                  • +
                                                                                                                  • else
                                                                                                                  • +
                                                                                                                  • error
                                                                                                                  • +
                                                                                                                  • fallthrough
                                                                                                                  • +
                                                                                                                  • float32
                                                                                                                  • +
                                                                                                                  • float64
                                                                                                                  • +
                                                                                                                  • for
                                                                                                                  • +
                                                                                                                  • func
                                                                                                                  • +
                                                                                                                  • go
                                                                                                                  • goto
                                                                                                                  • +
                                                                                                                  • if
                                                                                                                  • +
                                                                                                                  • import
                                                                                                                  • +
                                                                                                                  • int
                                                                                                                  • +
                                                                                                                  • int16
                                                                                                                  • +
                                                                                                                  • int32
                                                                                                                  • int64
                                                                                                                  • -
                                                                                                                  • else
                                                                                                                  • -
                                                                                                                  • continue
                                                                                                                  • int8
                                                                                                                  • -
                                                                                                                  • uint32
                                                                                                                  • -
                                                                                                                  • uint16
                                                                                                                  • +
                                                                                                                  • interface
                                                                                                                  • map
                                                                                                                  • -
                                                                                                                  • if
                                                                                                                  • -
                                                                                                                  • case
                                                                                                                  • +
                                                                                                                  • nil
                                                                                                                  • package
                                                                                                                  • -
                                                                                                                  • break
                                                                                                                  • -
                                                                                                                  • byte
                                                                                                                  • -
                                                                                                                  • var
                                                                                                                  • -
                                                                                                                  • go
                                                                                                                  • -
                                                                                                                  • float32
                                                                                                                  • +
                                                                                                                  • range
                                                                                                                  • +
                                                                                                                  • return
                                                                                                                  • +
                                                                                                                  • rune
                                                                                                                  • +
                                                                                                                  • select
                                                                                                                  • +
                                                                                                                  • string
                                                                                                                  • +
                                                                                                                  • struct
                                                                                                                  • +
                                                                                                                  • switch
                                                                                                                  • +
                                                                                                                  • type
                                                                                                                  • uint
                                                                                                                  • -
                                                                                                                  • int
                                                                                                                  • -
                                                                                                                  • int16
                                                                                                                  • -
                                                                                                                  • func
                                                                                                                  • -
                                                                                                                  • int32
                                                                                                                  • -
                                                                                                                  • complex128
                                                                                                                  • +
                                                                                                                  • uint16
                                                                                                                  • +
                                                                                                                  • uint32
                                                                                                                  • uint64
                                                                                                                  • uint8
                                                                                                                  • -
                                                                                                                  • chan
                                                                                                                  • -
                                                                                                                  • fallthrough
                                                                                                                  • uintptr
                                                                                                                  • -
                                                                                                                  • return
                                                                                                                  • +
                                                                                                                  • var
                                                                                                                  diff --git a/docs/generators/graphql-nodejs-express-server.md b/docs/generators/graphql-nodejs-express-server.md index ff521e80152b..8200c47531f5 100644 --- a/docs/generators/graphql-nodejs-express-server.md +++ b/docs/generators/graphql-nodejs-express-server.md @@ -5,30 +5,30 @@ sidebar_label: graphql-nodejs-express-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |packageName|GraphQL Node.js Express server package name (convention: lowercase).| |openapi3graphql-server| |packageVersion|GraphQL Node.js Express server package version.| |1.0.0| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -39,25 +39,25 @@ sidebar_label: graphql-nodejs-express-server ## LANGUAGE PRIMITIVES -
                                                                                                                  • Float
                                                                                                                  • -
                                                                                                                  • null
                                                                                                                  • +
                                                                                                                    • Boolean
                                                                                                                    • +
                                                                                                                    • Float
                                                                                                                    • ID
                                                                                                                    • -
                                                                                                                    • String
                                                                                                                    • -
                                                                                                                    • Boolean
                                                                                                                    • Int
                                                                                                                    • +
                                                                                                                    • String
                                                                                                                    • +
                                                                                                                    • null
                                                                                                                    ## RESERVED WORDS -
                                                                                                                    • implements
                                                                                                                    • -
                                                                                                                    • boolean
                                                                                                                    • +
                                                                                                                      • boolean
                                                                                                                      • +
                                                                                                                      • float
                                                                                                                      • +
                                                                                                                      • id
                                                                                                                      • +
                                                                                                                      • implements
                                                                                                                      • +
                                                                                                                      • int
                                                                                                                      • +
                                                                                                                      • interface
                                                                                                                      • null
                                                                                                                      • -
                                                                                                                      • string
                                                                                                                      • query
                                                                                                                      • -
                                                                                                                      • id
                                                                                                                      • -
                                                                                                                      • union
                                                                                                                      • -
                                                                                                                      • float
                                                                                                                      • +
                                                                                                                      • string
                                                                                                                      • type
                                                                                                                      • -
                                                                                                                      • interface
                                                                                                                      • -
                                                                                                                      • int
                                                                                                                      • +
                                                                                                                      • union
                                                                                                                      diff --git a/docs/generators/graphql-schema.md b/docs/generators/graphql-schema.md index f87416a2fb09..5cc481fa24ef 100644 --- a/docs/generators/graphql-schema.md +++ b/docs/generators/graphql-schema.md @@ -5,30 +5,30 @@ sidebar_label: graphql-schema | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |packageName|GraphQL package name (convention: lowercase).| |openapi2graphql| |packageVersion|GraphQL package version.| |1.0.0| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -39,25 +39,25 @@ sidebar_label: graphql-schema ## LANGUAGE PRIMITIVES -
                                                                                                                      • Float
                                                                                                                      • -
                                                                                                                      • null
                                                                                                                      • +
                                                                                                                        • Boolean
                                                                                                                        • +
                                                                                                                        • Float
                                                                                                                        • ID
                                                                                                                        • -
                                                                                                                        • String
                                                                                                                        • -
                                                                                                                        • Boolean
                                                                                                                        • Int
                                                                                                                        • +
                                                                                                                        • String
                                                                                                                        • +
                                                                                                                        • null
                                                                                                                        ## RESERVED WORDS -
                                                                                                                        • implements
                                                                                                                        • -
                                                                                                                        • boolean
                                                                                                                        • +
                                                                                                                          • boolean
                                                                                                                          • +
                                                                                                                          • float
                                                                                                                          • +
                                                                                                                          • id
                                                                                                                          • +
                                                                                                                          • implements
                                                                                                                          • +
                                                                                                                          • int
                                                                                                                          • +
                                                                                                                          • interface
                                                                                                                          • null
                                                                                                                          • -
                                                                                                                          • string
                                                                                                                          • query
                                                                                                                          • -
                                                                                                                          • id
                                                                                                                          • -
                                                                                                                          • union
                                                                                                                          • -
                                                                                                                          • float
                                                                                                                          • +
                                                                                                                          • string
                                                                                                                          • type
                                                                                                                          • -
                                                                                                                          • interface
                                                                                                                          • -
                                                                                                                          • int
                                                                                                                          • +
                                                                                                                          • union
                                                                                                                          diff --git a/docs/generators/graphql-server.md b/docs/generators/graphql-server.md deleted file mode 100644 index 97fb578008ab..000000000000 --- a/docs/generators/graphql-server.md +++ /dev/null @@ -1,12 +0,0 @@ - ---- -id: generator-opts-server-graphql-server -title: Config Options for graphql-server -sidebar_label: graphql-server ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|packageName|GraphQL express server package name (convention: lowercase).| |openapi3graphql-server| -|packageVersion|GraphQL express server package version.| |1.0.0| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index e1ec15d3b53d..13e9a1a61938 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -5,62 +5,62 @@ sidebar_label: groovy | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-groovy| |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                          **joda**
                                                                                                                          Joda (for legacy app only)
                                                                                                                          **legacy**
                                                                                                                          Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                          **java8-localdatetime**
                                                                                                                          Java 8 using LocalDateTime (for legacy app only)
                                                                                                                          **java8**
                                                                                                                          Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                          **threetenbp**
                                                                                                                          Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                          |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/groovy| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                          **joda**
                                                                                                                          Joda (for legacy app only)
                                                                                                                          **legacy**
                                                                                                                          Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                          **java8-localdatetime**
                                                                                                                          Java 8 using LocalDateTime (for legacy app only)
                                                                                                                          **java8**
                                                                                                                          Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                          **threetenbp**
                                                                                                                          Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                          |legacy| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                          **true**
                                                                                                                          Use Java 8 classes such as Base64
                                                                                                                          **false**
                                                                                                                          Various third party libraries as needed
                                                                                                                          |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                          **true**
                                                                                                                          Use a SnapShot Version
                                                                                                                          **false**
                                                                                                                          Use a Release Version
                                                                                                                          |null| +|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| |src/main/groovy| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -74,90 +74,90 @@ sidebar_label: groovy ## LANGUAGE PRIMITIVES
                                                                                                                          • ArrayList
                                                                                                                          • -
                                                                                                                          • String
                                                                                                                          • -
                                                                                                                          • Double
                                                                                                                          • +
                                                                                                                          • Boolean
                                                                                                                          • Date
                                                                                                                          • -
                                                                                                                          • Integer
                                                                                                                          • -
                                                                                                                          • byte[]
                                                                                                                          • +
                                                                                                                          • Double
                                                                                                                          • +
                                                                                                                          • File
                                                                                                                          • Float
                                                                                                                          • -
                                                                                                                          • boolean
                                                                                                                          • +
                                                                                                                          • Integer
                                                                                                                          • Long
                                                                                                                          • -
                                                                                                                          • Object
                                                                                                                          • -
                                                                                                                          • Boolean
                                                                                                                          • -
                                                                                                                          • File
                                                                                                                          • Map
                                                                                                                          • +
                                                                                                                          • Object
                                                                                                                          • +
                                                                                                                          • String
                                                                                                                          • +
                                                                                                                          • boolean
                                                                                                                          • +
                                                                                                                          • byte[]
                                                                                                                          ## RESERVED WORDS -
                                                                                                                          • localvaraccepts
                                                                                                                          • -
                                                                                                                          • synchronized
                                                                                                                          • -
                                                                                                                          • do
                                                                                                                          • -
                                                                                                                          • float
                                                                                                                          • -
                                                                                                                          • while
                                                                                                                          • -
                                                                                                                          • localvarpath
                                                                                                                          • -
                                                                                                                          • protected
                                                                                                                          • -
                                                                                                                          • continue
                                                                                                                          • -
                                                                                                                          • else
                                                                                                                          • +
                                                                                                                            • abstract
                                                                                                                            • apiclient
                                                                                                                            • -
                                                                                                                            • localvarqueryparams
                                                                                                                            • -
                                                                                                                            • catch
                                                                                                                            • -
                                                                                                                            • if
                                                                                                                            • +
                                                                                                                            • apiexception
                                                                                                                            • +
                                                                                                                            • apiresponse
                                                                                                                            • +
                                                                                                                            • assert
                                                                                                                            • +
                                                                                                                            • boolean
                                                                                                                            • +
                                                                                                                            • break
                                                                                                                            • +
                                                                                                                            • byte
                                                                                                                            • case
                                                                                                                            • -
                                                                                                                            • new
                                                                                                                            • -
                                                                                                                            • package
                                                                                                                            • -
                                                                                                                            • static
                                                                                                                            • -
                                                                                                                            • void
                                                                                                                            • -
                                                                                                                            • localvaraccept
                                                                                                                            • +
                                                                                                                            • catch
                                                                                                                            • +
                                                                                                                            • char
                                                                                                                            • +
                                                                                                                            • class
                                                                                                                            • +
                                                                                                                            • configuration
                                                                                                                            • +
                                                                                                                            • const
                                                                                                                            • +
                                                                                                                            • continue
                                                                                                                            • +
                                                                                                                            • default
                                                                                                                            • +
                                                                                                                            • do
                                                                                                                            • double
                                                                                                                            • -
                                                                                                                            • byte
                                                                                                                            • -
                                                                                                                            • finally
                                                                                                                            • -
                                                                                                                            • this
                                                                                                                            • -
                                                                                                                            • strictfp
                                                                                                                            • -
                                                                                                                            • throws
                                                                                                                            • +
                                                                                                                            • else
                                                                                                                            • enum
                                                                                                                            • extends
                                                                                                                            • -
                                                                                                                            • null
                                                                                                                            • -
                                                                                                                            • transient
                                                                                                                            • -
                                                                                                                            • apiexception
                                                                                                                            • final
                                                                                                                            • -
                                                                                                                            • try
                                                                                                                            • -
                                                                                                                            • object
                                                                                                                            • -
                                                                                                                            • localvarcontenttypes
                                                                                                                            • +
                                                                                                                            • finally
                                                                                                                            • +
                                                                                                                            • float
                                                                                                                            • +
                                                                                                                            • for
                                                                                                                            • +
                                                                                                                            • goto
                                                                                                                            • +
                                                                                                                            • if
                                                                                                                            • implements
                                                                                                                            • -
                                                                                                                            • private
                                                                                                                            • import
                                                                                                                            • -
                                                                                                                            • const
                                                                                                                            • -
                                                                                                                            • configuration
                                                                                                                            • -
                                                                                                                            • for
                                                                                                                            • -
                                                                                                                            • apiresponse
                                                                                                                            • +
                                                                                                                            • instanceof
                                                                                                                            • +
                                                                                                                            • int
                                                                                                                            • interface
                                                                                                                            • -
                                                                                                                            • long
                                                                                                                            • -
                                                                                                                            • switch
                                                                                                                            • -
                                                                                                                            • default
                                                                                                                            • -
                                                                                                                            • goto
                                                                                                                            • -
                                                                                                                            • public
                                                                                                                            • -
                                                                                                                            • localvarheaderparams
                                                                                                                            • -
                                                                                                                            • native
                                                                                                                            • -
                                                                                                                            • localvarcontenttype
                                                                                                                            • -
                                                                                                                            • assert
                                                                                                                            • -
                                                                                                                            • stringutil
                                                                                                                            • -
                                                                                                                            • class
                                                                                                                            • +
                                                                                                                            • localreturntype
                                                                                                                            • +
                                                                                                                            • localvaraccept
                                                                                                                            • +
                                                                                                                            • localvaraccepts
                                                                                                                            • +
                                                                                                                            • localvarauthnames
                                                                                                                            • localvarcollectionqueryparams
                                                                                                                            • +
                                                                                                                            • localvarcontenttype
                                                                                                                            • +
                                                                                                                            • localvarcontenttypes
                                                                                                                            • localvarcookieparams
                                                                                                                            • -
                                                                                                                            • localreturntype
                                                                                                                            • localvarformparams
                                                                                                                            • -
                                                                                                                            • break
                                                                                                                            • -
                                                                                                                            • volatile
                                                                                                                            • -
                                                                                                                            • localvarauthnames
                                                                                                                            • -
                                                                                                                            • abstract
                                                                                                                            • -
                                                                                                                            • int
                                                                                                                            • -
                                                                                                                            • instanceof
                                                                                                                            • -
                                                                                                                            • super
                                                                                                                            • -
                                                                                                                            • boolean
                                                                                                                            • -
                                                                                                                            • throw
                                                                                                                            • +
                                                                                                                            • localvarheaderparams
                                                                                                                            • +
                                                                                                                            • localvarpath
                                                                                                                            • localvarpostbody
                                                                                                                            • -
                                                                                                                            • char
                                                                                                                            • -
                                                                                                                            • short
                                                                                                                            • +
                                                                                                                            • localvarqueryparams
                                                                                                                            • +
                                                                                                                            • long
                                                                                                                            • +
                                                                                                                            • native
                                                                                                                            • +
                                                                                                                            • new
                                                                                                                            • +
                                                                                                                            • null
                                                                                                                            • +
                                                                                                                            • object
                                                                                                                            • +
                                                                                                                            • package
                                                                                                                            • +
                                                                                                                            • private
                                                                                                                            • +
                                                                                                                            • protected
                                                                                                                            • +
                                                                                                                            • public
                                                                                                                            • return
                                                                                                                            • +
                                                                                                                            • short
                                                                                                                            • +
                                                                                                                            • static
                                                                                                                            • +
                                                                                                                            • strictfp
                                                                                                                            • +
                                                                                                                            • stringutil
                                                                                                                            • +
                                                                                                                            • super
                                                                                                                            • +
                                                                                                                            • switch
                                                                                                                            • +
                                                                                                                            • synchronized
                                                                                                                            • +
                                                                                                                            • this
                                                                                                                            • +
                                                                                                                            • throw
                                                                                                                            • +
                                                                                                                            • throws
                                                                                                                            • +
                                                                                                                            • transient
                                                                                                                            • +
                                                                                                                            • try
                                                                                                                            • +
                                                                                                                            • void
                                                                                                                            • +
                                                                                                                            • volatile
                                                                                                                            • +
                                                                                                                            • while
                                                                                                                            diff --git a/docs/generators/grpc-schema.md b/docs/generators/grpc-schema.md deleted file mode 100644 index 17a765fbbcfa..000000000000 --- a/docs/generators/grpc-schema.md +++ /dev/null @@ -1,9 +0,0 @@ - ---- -id: generator-opts-config-grpc-schema -title: Config Options for grpc-schema -sidebar_label: grpc-schema ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index b0abf7faa173..3a68e2276a68 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -5,32 +5,32 @@ sidebar_label: haskell-http-client | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|allowFromJsonNulls|allow JSON Null during model decoding from JSON| |true| +|allowNonUniqueOperationIds|allow different API modules to contain the same operationId. Each API must be imported qualified| |false| +|allowToJsonNulls|allow emitting JSON Null during model encoding to JSON| |false| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|baseModule|Set the base module namespace| |null| |cabalPackage|Set the cabal package name, which consists of one or more alphanumeric words separated by hyphens| |null| |cabalVersion|Set the cabal version number, consisting of a sequence of one or more integers separated by dots| |null| -|baseModule|Set the base module namespace| |null| -|requestType|Set the name of the type used to generate requests| |null| |configType|Set the name of the type used for configuration| |null| -|allowFromJsonNulls|allow JSON Null during model decoding from JSON| |true| -|allowToJsonNulls|allow emitting JSON Null during model encoding to JSON| |false| -|allowNonUniqueOperationIds|allow different API modules to contain the same operationId. Each API must be imported qualified| |false| -|generateLenses|Generate Lens optics for Models| |true| -|generateModelConstructors|Generate smart constructors (only supply required fields) for models| |true| +|customTestInstanceModule|test module used to provide typeclass instances for types not known by the generator| |null| +|dateFormat|format string used to parse/render a date| |%Y-%m-%d| +|dateTimeFormat|format string used to parse/render a datetime| |null| +|dateTimeParseFormat|overrides the format string used to parse a datetime| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |generateEnums|Generate specific datatypes for OpenAPI enums| |true| |generateFormUrlEncodedInstances|Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded| |true| +|generateLenses|Generate Lens optics for Models| |true| +|generateModelConstructors|Generate smart constructors (only supply required fields) for models| |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |inlineMimeTypes|Inline (hardcode) the content-type and accept parameters on operations, when there is only 1 option| |true| |modelDeriving|Additional classes to include in the deriving() clause of Models| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|requestType|Set the name of the type used to generate requests| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |strictFields|Add strictness annotations to all model fields| |true| |useKatip|Sets the default value for the UseKatip cabal flag. If true, the katip package provides logging instead of monad-logger| |true| -|dateTimeFormat|format string used to parse/render a datetime| |null| -|dateTimeParseFormat|overrides the format string used to parse a datetime| |null| -|dateFormat|format string used to parse/render a date| |%Y-%m-%d| -|customTestInstanceModule|test module used to provide typeclass instances for types not known by the generator| |null| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| ## IMPORT MAPPING @@ -46,52 +46,52 @@ sidebar_label: haskell-http-client ## LANGUAGE PRIMITIVES -
                                                                                                                            • Integer
                                                                                                                            • +
                                                                                                                              • Bool
                                                                                                                              • +
                                                                                                                              • Char
                                                                                                                              • +
                                                                                                                              • Double
                                                                                                                              • FilePath
                                                                                                                              • Float
                                                                                                                              • -
                                                                                                                              • Bool
                                                                                                                              • -
                                                                                                                              • Char
                                                                                                                              • +
                                                                                                                              • Int
                                                                                                                              • +
                                                                                                                              • Integer
                                                                                                                              • List
                                                                                                                              • -
                                                                                                                              • Text
                                                                                                                              • String
                                                                                                                              • -
                                                                                                                              • Double
                                                                                                                              • -
                                                                                                                              • Int
                                                                                                                              • +
                                                                                                                              • Text
                                                                                                                              ## RESERVED WORDS -
                                                                                                                              • qualified
                                                                                                                              • -
                                                                                                                              • instance
                                                                                                                              • +
                                                                                                                                • accept
                                                                                                                                • +
                                                                                                                                • as
                                                                                                                                • +
                                                                                                                                • case
                                                                                                                                • +
                                                                                                                                • class
                                                                                                                                • +
                                                                                                                                • contenttype
                                                                                                                                • data
                                                                                                                                • -
                                                                                                                                • import
                                                                                                                                • -
                                                                                                                                • infixr
                                                                                                                                • +
                                                                                                                                • default
                                                                                                                                • +
                                                                                                                                • deriving
                                                                                                                                • do
                                                                                                                                • -
                                                                                                                                • type
                                                                                                                                • -
                                                                                                                                • pure
                                                                                                                                • +
                                                                                                                                • else
                                                                                                                                • +
                                                                                                                                • family
                                                                                                                                • +
                                                                                                                                • forall
                                                                                                                                • foreign
                                                                                                                                • -
                                                                                                                                • newtype
                                                                                                                                • hiding
                                                                                                                                • -
                                                                                                                                • rec
                                                                                                                                • -
                                                                                                                                • default
                                                                                                                                • -
                                                                                                                                • else
                                                                                                                                • -
                                                                                                                                • of
                                                                                                                                • -
                                                                                                                                • let
                                                                                                                                • -
                                                                                                                                • where
                                                                                                                                • -
                                                                                                                                • class
                                                                                                                                • if
                                                                                                                                • -
                                                                                                                                • case
                                                                                                                                • -
                                                                                                                                • proc
                                                                                                                                • +
                                                                                                                                • import
                                                                                                                                • in
                                                                                                                                • -
                                                                                                                                • forall
                                                                                                                                • -
                                                                                                                                • module
                                                                                                                                • -
                                                                                                                                • then
                                                                                                                                • infix
                                                                                                                                • -
                                                                                                                                • accept
                                                                                                                                • -
                                                                                                                                • contenttype
                                                                                                                                • -
                                                                                                                                • as
                                                                                                                                • -
                                                                                                                                • deriving
                                                                                                                                • infixl
                                                                                                                                • +
                                                                                                                                • infixr
                                                                                                                                • +
                                                                                                                                • instance
                                                                                                                                • +
                                                                                                                                • let
                                                                                                                                • mdo
                                                                                                                                • -
                                                                                                                                • family
                                                                                                                                • +
                                                                                                                                • module
                                                                                                                                • +
                                                                                                                                • newtype
                                                                                                                                • +
                                                                                                                                • of
                                                                                                                                • +
                                                                                                                                • proc
                                                                                                                                • +
                                                                                                                                • pure
                                                                                                                                • +
                                                                                                                                • qualified
                                                                                                                                • +
                                                                                                                                • rec
                                                                                                                                • return
                                                                                                                                • +
                                                                                                                                • then
                                                                                                                                • +
                                                                                                                                • type
                                                                                                                                • +
                                                                                                                                • where
                                                                                                                                diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 650ba8a60440..3e0cb77314db 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -5,14 +5,14 @@ sidebar_label: haskell | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|modelPackage|package for generated models| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serveStatic|serve will serve files from the directory 'static'.| |true| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING @@ -29,47 +29,47 @@ sidebar_label: haskell ## LANGUAGE PRIMITIVES -
                                                                                                                                • Integer
                                                                                                                                • +
                                                                                                                                  • Bool
                                                                                                                                  • +
                                                                                                                                  • Char
                                                                                                                                  • +
                                                                                                                                  • Double
                                                                                                                                  • FilePath
                                                                                                                                  • Float
                                                                                                                                  • -
                                                                                                                                  • Bool
                                                                                                                                  • -
                                                                                                                                  • Char
                                                                                                                                  • +
                                                                                                                                  • Int
                                                                                                                                  • +
                                                                                                                                  • Integer
                                                                                                                                  • List
                                                                                                                                  • String
                                                                                                                                  • -
                                                                                                                                  • Double
                                                                                                                                  • -
                                                                                                                                  • Int
                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                  • qualified
                                                                                                                                  • -
                                                                                                                                  • instance
                                                                                                                                  • +
                                                                                                                                    • as
                                                                                                                                    • +
                                                                                                                                    • case
                                                                                                                                    • +
                                                                                                                                    • class
                                                                                                                                    • data
                                                                                                                                    • -
                                                                                                                                    • import
                                                                                                                                    • -
                                                                                                                                    • infixr
                                                                                                                                    • +
                                                                                                                                    • default
                                                                                                                                    • +
                                                                                                                                    • deriving
                                                                                                                                    • do
                                                                                                                                    • -
                                                                                                                                    • type
                                                                                                                                    • +
                                                                                                                                    • else
                                                                                                                                    • +
                                                                                                                                    • family
                                                                                                                                    • +
                                                                                                                                    • forall
                                                                                                                                    • foreign
                                                                                                                                    • -
                                                                                                                                    • newtype
                                                                                                                                    • hiding
                                                                                                                                    • -
                                                                                                                                    • rec
                                                                                                                                    • -
                                                                                                                                    • default
                                                                                                                                    • -
                                                                                                                                    • else
                                                                                                                                    • -
                                                                                                                                    • of
                                                                                                                                    • -
                                                                                                                                    • let
                                                                                                                                    • -
                                                                                                                                    • where
                                                                                                                                    • -
                                                                                                                                    • class
                                                                                                                                    • if
                                                                                                                                    • -
                                                                                                                                    • case
                                                                                                                                    • -
                                                                                                                                    • proc
                                                                                                                                    • +
                                                                                                                                    • import
                                                                                                                                    • in
                                                                                                                                    • -
                                                                                                                                    • forall
                                                                                                                                    • -
                                                                                                                                    • module
                                                                                                                                    • -
                                                                                                                                    • then
                                                                                                                                    • infix
                                                                                                                                    • -
                                                                                                                                    • as
                                                                                                                                    • -
                                                                                                                                    • deriving
                                                                                                                                    • infixl
                                                                                                                                    • +
                                                                                                                                    • infixr
                                                                                                                                    • +
                                                                                                                                    • instance
                                                                                                                                    • +
                                                                                                                                    • let
                                                                                                                                    • mdo
                                                                                                                                    • -
                                                                                                                                    • family
                                                                                                                                    • +
                                                                                                                                    • module
                                                                                                                                    • +
                                                                                                                                    • newtype
                                                                                                                                    • +
                                                                                                                                    • of
                                                                                                                                    • +
                                                                                                                                    • proc
                                                                                                                                    • +
                                                                                                                                    • qualified
                                                                                                                                    • +
                                                                                                                                    • rec
                                                                                                                                    • +
                                                                                                                                    • then
                                                                                                                                    • +
                                                                                                                                    • type
                                                                                                                                    • +
                                                                                                                                    • where
                                                                                                                                    diff --git a/docs/generators/html.md b/docs/generators/html.md index f0e0d3fe2260..d538d0f91d69 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -5,21 +5,21 @@ sidebar_label: html | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|appName|short name of the application| |null| |appDescription|description of the application| |null| -|infoUrl|a URL where users can get more information about the application| |null| +|appName|short name of the application| |null| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| +|infoUrl|a URL where users can get more information about the application| |null| +|invokerPackage|root package for generated code| |null| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| -|invokerPackage|root package for generated code| |null| -|groupId|groupId in generated pom.xml| |null| -|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|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| ## IMPORT MAPPING diff --git a/docs/generators/html2.md b/docs/generators/html2.md index cc4f54256284..82374353c401 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -5,25 +5,25 @@ sidebar_label: html2 | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|appName|short name of the application| |null| |appDescription|description of the application| |null| -|infoUrl|a URL where users can get more information about the application| |null| +|appName|short name of the application| |null| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| +|infoUrl|a URL where users can get more information about the application| |null| +|invokerPackage|root package for generated code| |null| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| -|invokerPackage|root package for generated code| |null| -|phpInvokerPackage|root package for generated php code| |null| +|packageName|C# package name| |null| |perlModuleName|root module name for generated perl code| |null| +|phpInvokerPackage|root package for generated php code| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pythonPackageName|package name for generated python code| |null| -|packageName|C# package name| |null| -|groupId|groupId in generated pom.xml| |null| -|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |null| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index fd9ecfa5211c..9a0da4b39a1d 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -5,64 +5,64 @@ sidebar_label: java-inflector | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.controllers| -|invokerPackage|root package for generated code| |org.openapitools.controllers| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-inflector-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                    **joda**
                                                                                                                                    Joda (for legacy app only)
                                                                                                                                    **legacy**
                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                    **java8-localdatetime**
                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                    **java8**
                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                    **threetenbp**
                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/gen/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                    **joda**
                                                                                                                                    Joda (for legacy app only)
                                                                                                                                    **legacy**
                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                    **java8-localdatetime**
                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                    **java8**
                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                    **threetenbp**
                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                    |legacy| +|invokerPackage|root package for generated code| |org.openapitools.controllers| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                    **true**
                                                                                                                                    Use Java 8 classes such as Base64
                                                                                                                                    **false**
                                                                                                                                    Various third party libraries as needed
                                                                                                                                    |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                    **true**
                                                                                                                                    Use a SnapShot Version
                                                                                                                                    **false**
                                                                                                                                    Use a Release Version
                                                                                                                                    |null| +|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| |src/gen/java| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -75,87 +75,87 @@ sidebar_label: java-inflector ## LANGUAGE PRIMITIVES -
                                                                                                                                    • Integer
                                                                                                                                    • -
                                                                                                                                    • byte[]
                                                                                                                                    • +
                                                                                                                                      • Boolean
                                                                                                                                      • +
                                                                                                                                      • Double
                                                                                                                                      • Float
                                                                                                                                      • -
                                                                                                                                      • boolean
                                                                                                                                      • +
                                                                                                                                      • Integer
                                                                                                                                      • Long
                                                                                                                                      • Object
                                                                                                                                      • String
                                                                                                                                      • -
                                                                                                                                      • Boolean
                                                                                                                                      • -
                                                                                                                                      • Double
                                                                                                                                      • +
                                                                                                                                      • boolean
                                                                                                                                      • +
                                                                                                                                      • byte[]
                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                      • localvaraccepts
                                                                                                                                      • -
                                                                                                                                      • synchronized
                                                                                                                                      • -
                                                                                                                                      • do
                                                                                                                                      • -
                                                                                                                                      • float
                                                                                                                                      • -
                                                                                                                                      • while
                                                                                                                                      • -
                                                                                                                                      • localvarpath
                                                                                                                                      • -
                                                                                                                                      • protected
                                                                                                                                      • -
                                                                                                                                      • continue
                                                                                                                                      • -
                                                                                                                                      • else
                                                                                                                                      • +
                                                                                                                                        • abstract
                                                                                                                                        • apiclient
                                                                                                                                        • -
                                                                                                                                        • localvarqueryparams
                                                                                                                                        • -
                                                                                                                                        • catch
                                                                                                                                        • -
                                                                                                                                        • if
                                                                                                                                        • +
                                                                                                                                        • apiexception
                                                                                                                                        • +
                                                                                                                                        • apiresponse
                                                                                                                                        • +
                                                                                                                                        • assert
                                                                                                                                        • +
                                                                                                                                        • boolean
                                                                                                                                        • +
                                                                                                                                        • break
                                                                                                                                        • +
                                                                                                                                        • byte
                                                                                                                                        • case
                                                                                                                                        • -
                                                                                                                                        • new
                                                                                                                                        • -
                                                                                                                                        • package
                                                                                                                                        • -
                                                                                                                                        • static
                                                                                                                                        • -
                                                                                                                                        • void
                                                                                                                                        • -
                                                                                                                                        • localvaraccept
                                                                                                                                        • +
                                                                                                                                        • catch
                                                                                                                                        • +
                                                                                                                                        • char
                                                                                                                                        • +
                                                                                                                                        • class
                                                                                                                                        • +
                                                                                                                                        • configuration
                                                                                                                                        • +
                                                                                                                                        • const
                                                                                                                                        • +
                                                                                                                                        • continue
                                                                                                                                        • +
                                                                                                                                        • default
                                                                                                                                        • +
                                                                                                                                        • do
                                                                                                                                        • double
                                                                                                                                        • -
                                                                                                                                        • byte
                                                                                                                                        • -
                                                                                                                                        • finally
                                                                                                                                        • -
                                                                                                                                        • this
                                                                                                                                        • -
                                                                                                                                        • strictfp
                                                                                                                                        • -
                                                                                                                                        • throws
                                                                                                                                        • +
                                                                                                                                        • else
                                                                                                                                        • enum
                                                                                                                                        • extends
                                                                                                                                        • -
                                                                                                                                        • null
                                                                                                                                        • -
                                                                                                                                        • transient
                                                                                                                                        • -
                                                                                                                                        • apiexception
                                                                                                                                        • final
                                                                                                                                        • -
                                                                                                                                        • try
                                                                                                                                        • -
                                                                                                                                        • object
                                                                                                                                        • -
                                                                                                                                        • localvarcontenttypes
                                                                                                                                        • +
                                                                                                                                        • finally
                                                                                                                                        • +
                                                                                                                                        • float
                                                                                                                                        • +
                                                                                                                                        • for
                                                                                                                                        • +
                                                                                                                                        • goto
                                                                                                                                        • +
                                                                                                                                        • if
                                                                                                                                        • implements
                                                                                                                                        • -
                                                                                                                                        • private
                                                                                                                                        • import
                                                                                                                                        • -
                                                                                                                                        • const
                                                                                                                                        • -
                                                                                                                                        • configuration
                                                                                                                                        • -
                                                                                                                                        • for
                                                                                                                                        • -
                                                                                                                                        • apiresponse
                                                                                                                                        • +
                                                                                                                                        • instanceof
                                                                                                                                        • +
                                                                                                                                        • int
                                                                                                                                        • interface
                                                                                                                                        • -
                                                                                                                                        • long
                                                                                                                                        • -
                                                                                                                                        • switch
                                                                                                                                        • -
                                                                                                                                        • default
                                                                                                                                        • -
                                                                                                                                        • goto
                                                                                                                                        • -
                                                                                                                                        • public
                                                                                                                                        • -
                                                                                                                                        • localvarheaderparams
                                                                                                                                        • -
                                                                                                                                        • native
                                                                                                                                        • -
                                                                                                                                        • localvarcontenttype
                                                                                                                                        • -
                                                                                                                                        • assert
                                                                                                                                        • -
                                                                                                                                        • stringutil
                                                                                                                                        • -
                                                                                                                                        • class
                                                                                                                                        • +
                                                                                                                                        • localreturntype
                                                                                                                                        • +
                                                                                                                                        • localvaraccept
                                                                                                                                        • +
                                                                                                                                        • localvaraccepts
                                                                                                                                        • +
                                                                                                                                        • localvarauthnames
                                                                                                                                        • localvarcollectionqueryparams
                                                                                                                                        • +
                                                                                                                                        • localvarcontenttype
                                                                                                                                        • +
                                                                                                                                        • localvarcontenttypes
                                                                                                                                        • localvarcookieparams
                                                                                                                                        • -
                                                                                                                                        • localreturntype
                                                                                                                                        • localvarformparams
                                                                                                                                        • -
                                                                                                                                        • break
                                                                                                                                        • -
                                                                                                                                        • volatile
                                                                                                                                        • -
                                                                                                                                        • localvarauthnames
                                                                                                                                        • -
                                                                                                                                        • abstract
                                                                                                                                        • -
                                                                                                                                        • int
                                                                                                                                        • -
                                                                                                                                        • instanceof
                                                                                                                                        • -
                                                                                                                                        • super
                                                                                                                                        • -
                                                                                                                                        • boolean
                                                                                                                                        • -
                                                                                                                                        • throw
                                                                                                                                        • +
                                                                                                                                        • localvarheaderparams
                                                                                                                                        • +
                                                                                                                                        • localvarpath
                                                                                                                                        • localvarpostbody
                                                                                                                                        • -
                                                                                                                                        • char
                                                                                                                                        • -
                                                                                                                                        • short
                                                                                                                                        • +
                                                                                                                                        • localvarqueryparams
                                                                                                                                        • +
                                                                                                                                        • long
                                                                                                                                        • +
                                                                                                                                        • native
                                                                                                                                        • +
                                                                                                                                        • new
                                                                                                                                        • +
                                                                                                                                        • null
                                                                                                                                        • +
                                                                                                                                        • object
                                                                                                                                        • +
                                                                                                                                        • package
                                                                                                                                        • +
                                                                                                                                        • private
                                                                                                                                        • +
                                                                                                                                        • protected
                                                                                                                                        • +
                                                                                                                                        • public
                                                                                                                                        • return
                                                                                                                                        • +
                                                                                                                                        • short
                                                                                                                                        • +
                                                                                                                                        • static
                                                                                                                                        • +
                                                                                                                                        • strictfp
                                                                                                                                        • +
                                                                                                                                        • stringutil
                                                                                                                                        • +
                                                                                                                                        • super
                                                                                                                                        • +
                                                                                                                                        • switch
                                                                                                                                        • +
                                                                                                                                        • synchronized
                                                                                                                                        • +
                                                                                                                                        • this
                                                                                                                                        • +
                                                                                                                                        • throw
                                                                                                                                        • +
                                                                                                                                        • throws
                                                                                                                                        • +
                                                                                                                                        • transient
                                                                                                                                        • +
                                                                                                                                        • try
                                                                                                                                        • +
                                                                                                                                        • void
                                                                                                                                        • +
                                                                                                                                        • volatile
                                                                                                                                        • +
                                                                                                                                        • while
                                                                                                                                        diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 30f52f7ded8c..d0ecb290ff81 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -5,69 +5,69 @@ sidebar_label: java-msf4j | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                        **joda**
                                                                                                                                        Joda (for legacy app only)
                                                                                                                                        **legacy**
                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                        **java8-localdatetime**
                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                        **java8**
                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                        **threetenbp**
                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                        |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                        **joda**
                                                                                                                                        Joda (for legacy app only)
                                                                                                                                        **legacy**
                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                        **java8-localdatetime**
                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                        **java8**
                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                        **threetenbp**
                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                        |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                        **true**
                                                                                                                                        Use Java 8 classes such as Base64
                                                                                                                                        **false**
                                                                                                                                        Various third party libraries as needed
                                                                                                                                        |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|library|library template (sub-template)|
                                                                                                                                        **jersey1**
                                                                                                                                        Jersey core 1.x
                                                                                                                                        **jersey2**
                                                                                                                                        Jersey core 2.x
                                                                                                                                        |jersey2| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                        **true**
                                                                                                                                        Use a SnapShot Version
                                                                                                                                        **false**
                                                                                                                                        Use a Release Version
                                                                                                                                        |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/main/java| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|library|library template (sub-template)|
                                                                                                                                        **jersey1**
                                                                                                                                        Jersey core 1.x
                                                                                                                                        **jersey2**
                                                                                                                                        Jersey core 2.x
                                                                                                                                        |jersey2| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -80,87 +80,87 @@ sidebar_label: java-msf4j ## LANGUAGE PRIMITIVES -
                                                                                                                                        • Integer
                                                                                                                                        • -
                                                                                                                                        • byte[]
                                                                                                                                        • +
                                                                                                                                          • Boolean
                                                                                                                                          • +
                                                                                                                                          • Double
                                                                                                                                          • Float
                                                                                                                                          • -
                                                                                                                                          • boolean
                                                                                                                                          • +
                                                                                                                                          • Integer
                                                                                                                                          • Long
                                                                                                                                          • Object
                                                                                                                                          • String
                                                                                                                                          • -
                                                                                                                                          • Boolean
                                                                                                                                          • -
                                                                                                                                          • Double
                                                                                                                                          • +
                                                                                                                                          • boolean
                                                                                                                                          • +
                                                                                                                                          • byte[]
                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                          • localvaraccepts
                                                                                                                                          • -
                                                                                                                                          • synchronized
                                                                                                                                          • -
                                                                                                                                          • do
                                                                                                                                          • -
                                                                                                                                          • float
                                                                                                                                          • -
                                                                                                                                          • while
                                                                                                                                          • -
                                                                                                                                          • localvarpath
                                                                                                                                          • -
                                                                                                                                          • protected
                                                                                                                                          • -
                                                                                                                                          • continue
                                                                                                                                          • -
                                                                                                                                          • else
                                                                                                                                          • +
                                                                                                                                            • abstract
                                                                                                                                            • apiclient
                                                                                                                                            • -
                                                                                                                                            • localvarqueryparams
                                                                                                                                            • -
                                                                                                                                            • catch
                                                                                                                                            • -
                                                                                                                                            • if
                                                                                                                                            • +
                                                                                                                                            • apiexception
                                                                                                                                            • +
                                                                                                                                            • apiresponse
                                                                                                                                            • +
                                                                                                                                            • assert
                                                                                                                                            • +
                                                                                                                                            • boolean
                                                                                                                                            • +
                                                                                                                                            • break
                                                                                                                                            • +
                                                                                                                                            • byte
                                                                                                                                            • case
                                                                                                                                            • -
                                                                                                                                            • new
                                                                                                                                            • -
                                                                                                                                            • package
                                                                                                                                            • -
                                                                                                                                            • static
                                                                                                                                            • -
                                                                                                                                            • void
                                                                                                                                            • -
                                                                                                                                            • localvaraccept
                                                                                                                                            • +
                                                                                                                                            • catch
                                                                                                                                            • +
                                                                                                                                            • char
                                                                                                                                            • +
                                                                                                                                            • class
                                                                                                                                            • +
                                                                                                                                            • configuration
                                                                                                                                            • +
                                                                                                                                            • const
                                                                                                                                            • +
                                                                                                                                            • continue
                                                                                                                                            • +
                                                                                                                                            • default
                                                                                                                                            • +
                                                                                                                                            • do
                                                                                                                                            • double
                                                                                                                                            • -
                                                                                                                                            • byte
                                                                                                                                            • -
                                                                                                                                            • finally
                                                                                                                                            • -
                                                                                                                                            • this
                                                                                                                                            • -
                                                                                                                                            • strictfp
                                                                                                                                            • -
                                                                                                                                            • throws
                                                                                                                                            • +
                                                                                                                                            • else
                                                                                                                                            • enum
                                                                                                                                            • extends
                                                                                                                                            • -
                                                                                                                                            • null
                                                                                                                                            • -
                                                                                                                                            • transient
                                                                                                                                            • -
                                                                                                                                            • apiexception
                                                                                                                                            • final
                                                                                                                                            • -
                                                                                                                                            • try
                                                                                                                                            • -
                                                                                                                                            • object
                                                                                                                                            • -
                                                                                                                                            • localvarcontenttypes
                                                                                                                                            • +
                                                                                                                                            • finally
                                                                                                                                            • +
                                                                                                                                            • float
                                                                                                                                            • +
                                                                                                                                            • for
                                                                                                                                            • +
                                                                                                                                            • goto
                                                                                                                                            • +
                                                                                                                                            • if
                                                                                                                                            • implements
                                                                                                                                            • -
                                                                                                                                            • private
                                                                                                                                            • import
                                                                                                                                            • -
                                                                                                                                            • const
                                                                                                                                            • -
                                                                                                                                            • configuration
                                                                                                                                            • -
                                                                                                                                            • for
                                                                                                                                            • -
                                                                                                                                            • apiresponse
                                                                                                                                            • +
                                                                                                                                            • instanceof
                                                                                                                                            • +
                                                                                                                                            • int
                                                                                                                                            • interface
                                                                                                                                            • -
                                                                                                                                            • long
                                                                                                                                            • -
                                                                                                                                            • switch
                                                                                                                                            • -
                                                                                                                                            • default
                                                                                                                                            • -
                                                                                                                                            • goto
                                                                                                                                            • -
                                                                                                                                            • public
                                                                                                                                            • -
                                                                                                                                            • localvarheaderparams
                                                                                                                                            • -
                                                                                                                                            • native
                                                                                                                                            • -
                                                                                                                                            • localvarcontenttype
                                                                                                                                            • -
                                                                                                                                            • assert
                                                                                                                                            • -
                                                                                                                                            • stringutil
                                                                                                                                            • -
                                                                                                                                            • class
                                                                                                                                            • +
                                                                                                                                            • localreturntype
                                                                                                                                            • +
                                                                                                                                            • localvaraccept
                                                                                                                                            • +
                                                                                                                                            • localvaraccepts
                                                                                                                                            • +
                                                                                                                                            • localvarauthnames
                                                                                                                                            • localvarcollectionqueryparams
                                                                                                                                            • +
                                                                                                                                            • localvarcontenttype
                                                                                                                                            • +
                                                                                                                                            • localvarcontenttypes
                                                                                                                                            • localvarcookieparams
                                                                                                                                            • -
                                                                                                                                            • localreturntype
                                                                                                                                            • localvarformparams
                                                                                                                                            • -
                                                                                                                                            • break
                                                                                                                                            • -
                                                                                                                                            • volatile
                                                                                                                                            • -
                                                                                                                                            • localvarauthnames
                                                                                                                                            • -
                                                                                                                                            • abstract
                                                                                                                                            • -
                                                                                                                                            • int
                                                                                                                                            • -
                                                                                                                                            • instanceof
                                                                                                                                            • -
                                                                                                                                            • super
                                                                                                                                            • -
                                                                                                                                            • boolean
                                                                                                                                            • -
                                                                                                                                            • throw
                                                                                                                                            • +
                                                                                                                                            • localvarheaderparams
                                                                                                                                            • +
                                                                                                                                            • localvarpath
                                                                                                                                            • localvarpostbody
                                                                                                                                            • -
                                                                                                                                            • char
                                                                                                                                            • -
                                                                                                                                            • short
                                                                                                                                            • +
                                                                                                                                            • localvarqueryparams
                                                                                                                                            • +
                                                                                                                                            • long
                                                                                                                                            • +
                                                                                                                                            • native
                                                                                                                                            • +
                                                                                                                                            • new
                                                                                                                                            • +
                                                                                                                                            • null
                                                                                                                                            • +
                                                                                                                                            • object
                                                                                                                                            • +
                                                                                                                                            • package
                                                                                                                                            • +
                                                                                                                                            • private
                                                                                                                                            • +
                                                                                                                                            • protected
                                                                                                                                            • +
                                                                                                                                            • public
                                                                                                                                            • return
                                                                                                                                            • +
                                                                                                                                            • short
                                                                                                                                            • +
                                                                                                                                            • static
                                                                                                                                            • +
                                                                                                                                            • strictfp
                                                                                                                                            • +
                                                                                                                                            • stringutil
                                                                                                                                            • +
                                                                                                                                            • super
                                                                                                                                            • +
                                                                                                                                            • switch
                                                                                                                                            • +
                                                                                                                                            • synchronized
                                                                                                                                            • +
                                                                                                                                            • this
                                                                                                                                            • +
                                                                                                                                            • throw
                                                                                                                                            • +
                                                                                                                                            • throws
                                                                                                                                            • +
                                                                                                                                            • transient
                                                                                                                                            • +
                                                                                                                                            • try
                                                                                                                                            • +
                                                                                                                                            • void
                                                                                                                                            • +
                                                                                                                                            • volatile
                                                                                                                                            • +
                                                                                                                                            • while
                                                                                                                                            diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index bb16e088e042..8ab96c097dd3 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -5,71 +5,71 @@ sidebar_label: java-pkmst | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |com.prokarma.pkmst.model| |apiPackage|package for generated api classes| |com.prokarma.pkmst.controller| -|invokerPackage|root package for generated code| |com.prokarma.pkmst.controller| -|groupId|groupId in generated pom.xml| |com.prokarma| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |pkmst-microservice| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|basePackage|base package for java source code| |null| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                            **joda**
                                                                                                                                            Joda (for legacy app only)
                                                                                                                                            **legacy**
                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                            **java8-localdatetime**
                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                            **java8**
                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                            **threetenbp**
                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                            |threetenbp| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|eurekaUri|Eureka URI| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |com.prokarma| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                            **joda**
                                                                                                                                            Joda (for legacy app only)
                                                                                                                                            **legacy**
                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                            **java8-localdatetime**
                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                            **java8**
                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                            **threetenbp**
                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                            |threetenbp| +|invokerPackage|root package for generated code| |com.prokarma.pkmst.controller| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                            **true**
                                                                                                                                            Use Java 8 classes such as Base64
                                                                                                                                            **false**
                                                                                                                                            Various third party libraries as needed
                                                                                                                                            |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |com.prokarma.pkmst.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| -|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                            **true**
                                                                                                                                            Use a SnapShot Version
                                                                                                                                            **false**
                                                                                                                                            Use a Release Version
                                                                                                                                            |null| -|basePackage|base package for java source code| |null| +|pkmstInterceptor|PKMST Interceptor| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |serviceName|Service Name| |null| +|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                            **true**
                                                                                                                                            Use a SnapShot Version
                                                                                                                                            **false**
                                                                                                                                            Use a Release Version
                                                                                                                                            |null| +|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| |src/main/java| +|springBootAdminUri|Spring-Boot URI| |null| |title|server title name or client service name| |null| -|eurekaUri|Eureka URI| |null| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| |zipkinUri|Zipkin URI| |null| -|springBootAdminUri|Spring-Boot URI| |null| -|pkmstInterceptor|PKMST Interceptor| |null| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -82,87 +82,87 @@ sidebar_label: java-pkmst ## LANGUAGE PRIMITIVES -
                                                                                                                                            • Integer
                                                                                                                                            • -
                                                                                                                                            • byte[]
                                                                                                                                            • +
                                                                                                                                              • Boolean
                                                                                                                                              • +
                                                                                                                                              • Double
                                                                                                                                              • Float
                                                                                                                                              • -
                                                                                                                                              • boolean
                                                                                                                                              • +
                                                                                                                                              • Integer
                                                                                                                                              • Long
                                                                                                                                              • Object
                                                                                                                                              • String
                                                                                                                                              • -
                                                                                                                                              • Boolean
                                                                                                                                              • -
                                                                                                                                              • Double
                                                                                                                                              • +
                                                                                                                                              • boolean
                                                                                                                                              • +
                                                                                                                                              • byte[]
                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                              • localvaraccepts
                                                                                                                                              • -
                                                                                                                                              • synchronized
                                                                                                                                              • -
                                                                                                                                              • do
                                                                                                                                              • -
                                                                                                                                              • float
                                                                                                                                              • -
                                                                                                                                              • while
                                                                                                                                              • -
                                                                                                                                              • localvarpath
                                                                                                                                              • -
                                                                                                                                              • protected
                                                                                                                                              • -
                                                                                                                                              • continue
                                                                                                                                              • -
                                                                                                                                              • else
                                                                                                                                              • +
                                                                                                                                                • abstract
                                                                                                                                                • apiclient
                                                                                                                                                • -
                                                                                                                                                • localvarqueryparams
                                                                                                                                                • -
                                                                                                                                                • catch
                                                                                                                                                • -
                                                                                                                                                • if
                                                                                                                                                • +
                                                                                                                                                • apiexception
                                                                                                                                                • +
                                                                                                                                                • apiresponse
                                                                                                                                                • +
                                                                                                                                                • assert
                                                                                                                                                • +
                                                                                                                                                • boolean
                                                                                                                                                • +
                                                                                                                                                • break
                                                                                                                                                • +
                                                                                                                                                • byte
                                                                                                                                                • case
                                                                                                                                                • -
                                                                                                                                                • new
                                                                                                                                                • -
                                                                                                                                                • package
                                                                                                                                                • -
                                                                                                                                                • static
                                                                                                                                                • -
                                                                                                                                                • void
                                                                                                                                                • -
                                                                                                                                                • localvaraccept
                                                                                                                                                • +
                                                                                                                                                • catch
                                                                                                                                                • +
                                                                                                                                                • char
                                                                                                                                                • +
                                                                                                                                                • class
                                                                                                                                                • +
                                                                                                                                                • configuration
                                                                                                                                                • +
                                                                                                                                                • const
                                                                                                                                                • +
                                                                                                                                                • continue
                                                                                                                                                • +
                                                                                                                                                • default
                                                                                                                                                • +
                                                                                                                                                • do
                                                                                                                                                • double
                                                                                                                                                • -
                                                                                                                                                • byte
                                                                                                                                                • -
                                                                                                                                                • finally
                                                                                                                                                • -
                                                                                                                                                • this
                                                                                                                                                • -
                                                                                                                                                • strictfp
                                                                                                                                                • -
                                                                                                                                                • throws
                                                                                                                                                • +
                                                                                                                                                • else
                                                                                                                                                • enum
                                                                                                                                                • extends
                                                                                                                                                • -
                                                                                                                                                • null
                                                                                                                                                • -
                                                                                                                                                • transient
                                                                                                                                                • -
                                                                                                                                                • apiexception
                                                                                                                                                • final
                                                                                                                                                • -
                                                                                                                                                • try
                                                                                                                                                • -
                                                                                                                                                • object
                                                                                                                                                • -
                                                                                                                                                • localvarcontenttypes
                                                                                                                                                • +
                                                                                                                                                • finally
                                                                                                                                                • +
                                                                                                                                                • float
                                                                                                                                                • +
                                                                                                                                                • for
                                                                                                                                                • +
                                                                                                                                                • goto
                                                                                                                                                • +
                                                                                                                                                • if
                                                                                                                                                • implements
                                                                                                                                                • -
                                                                                                                                                • private
                                                                                                                                                • import
                                                                                                                                                • -
                                                                                                                                                • const
                                                                                                                                                • -
                                                                                                                                                • configuration
                                                                                                                                                • -
                                                                                                                                                • for
                                                                                                                                                • -
                                                                                                                                                • apiresponse
                                                                                                                                                • +
                                                                                                                                                • instanceof
                                                                                                                                                • +
                                                                                                                                                • int
                                                                                                                                                • interface
                                                                                                                                                • -
                                                                                                                                                • long
                                                                                                                                                • -
                                                                                                                                                • switch
                                                                                                                                                • -
                                                                                                                                                • default
                                                                                                                                                • -
                                                                                                                                                • goto
                                                                                                                                                • -
                                                                                                                                                • public
                                                                                                                                                • -
                                                                                                                                                • localvarheaderparams
                                                                                                                                                • -
                                                                                                                                                • native
                                                                                                                                                • -
                                                                                                                                                • localvarcontenttype
                                                                                                                                                • -
                                                                                                                                                • assert
                                                                                                                                                • -
                                                                                                                                                • stringutil
                                                                                                                                                • -
                                                                                                                                                • class
                                                                                                                                                • +
                                                                                                                                                • localreturntype
                                                                                                                                                • +
                                                                                                                                                • localvaraccept
                                                                                                                                                • +
                                                                                                                                                • localvaraccepts
                                                                                                                                                • +
                                                                                                                                                • localvarauthnames
                                                                                                                                                • localvarcollectionqueryparams
                                                                                                                                                • +
                                                                                                                                                • localvarcontenttype
                                                                                                                                                • +
                                                                                                                                                • localvarcontenttypes
                                                                                                                                                • localvarcookieparams
                                                                                                                                                • -
                                                                                                                                                • localreturntype
                                                                                                                                                • localvarformparams
                                                                                                                                                • -
                                                                                                                                                • break
                                                                                                                                                • -
                                                                                                                                                • volatile
                                                                                                                                                • -
                                                                                                                                                • localvarauthnames
                                                                                                                                                • -
                                                                                                                                                • abstract
                                                                                                                                                • -
                                                                                                                                                • int
                                                                                                                                                • -
                                                                                                                                                • instanceof
                                                                                                                                                • -
                                                                                                                                                • super
                                                                                                                                                • -
                                                                                                                                                • boolean
                                                                                                                                                • -
                                                                                                                                                • throw
                                                                                                                                                • +
                                                                                                                                                • localvarheaderparams
                                                                                                                                                • +
                                                                                                                                                • localvarpath
                                                                                                                                                • localvarpostbody
                                                                                                                                                • -
                                                                                                                                                • char
                                                                                                                                                • -
                                                                                                                                                • short
                                                                                                                                                • +
                                                                                                                                                • localvarqueryparams
                                                                                                                                                • +
                                                                                                                                                • long
                                                                                                                                                • +
                                                                                                                                                • native
                                                                                                                                                • +
                                                                                                                                                • new
                                                                                                                                                • +
                                                                                                                                                • null
                                                                                                                                                • +
                                                                                                                                                • object
                                                                                                                                                • +
                                                                                                                                                • package
                                                                                                                                                • +
                                                                                                                                                • private
                                                                                                                                                • +
                                                                                                                                                • protected
                                                                                                                                                • +
                                                                                                                                                • public
                                                                                                                                                • return
                                                                                                                                                • +
                                                                                                                                                • short
                                                                                                                                                • +
                                                                                                                                                • static
                                                                                                                                                • +
                                                                                                                                                • strictfp
                                                                                                                                                • +
                                                                                                                                                • stringutil
                                                                                                                                                • +
                                                                                                                                                • super
                                                                                                                                                • +
                                                                                                                                                • switch
                                                                                                                                                • +
                                                                                                                                                • synchronized
                                                                                                                                                • +
                                                                                                                                                • this
                                                                                                                                                • +
                                                                                                                                                • throw
                                                                                                                                                • +
                                                                                                                                                • throws
                                                                                                                                                • +
                                                                                                                                                • transient
                                                                                                                                                • +
                                                                                                                                                • try
                                                                                                                                                • +
                                                                                                                                                • void
                                                                                                                                                • +
                                                                                                                                                • volatile
                                                                                                                                                • +
                                                                                                                                                • while
                                                                                                                                                diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 0cf0804b36fc..c0875184092f 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -5,73 +5,73 @@ sidebar_label: java-play-framework | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |apimodels| |apiPackage|package for generated api classes| |controllers| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-playframework| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|basePackage|base package for generated code| |org.openapitools| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|configPackage|configuration package for generated code| |org.openapitools.configuration| +|controllerOnly|Whether to generate only API interface stubs without the server files.| |false| +|dateLibrary|Option. Date library to use|
                                                                                                                                                **joda**
                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                **legacy**
                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                **java8-localdatetime**
                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                **java8**
                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                **threetenbp**
                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                |threetenbp| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |/app| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| +|handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                **joda**
                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                **legacy**
                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                **java8-localdatetime**
                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                **java8**
                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                **threetenbp**
                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                |threetenbp| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                **true**
                                                                                                                                                Use Java 8 classes such as Base64
                                                                                                                                                **false**
                                                                                                                                                Various third party libraries as needed
                                                                                                                                                |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |apimodels| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                **true**
                                                                                                                                                Use a SnapShot Version
                                                                                                                                                **false**
                                                                                                                                                Use a Release Version
                                                                                                                                                |null| +|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| |/app| |title|server title name or client service name| |openapi-java-playframework| -|configPackage|configuration package for generated code| |org.openapitools.configuration| -|basePackage|base package for generated code| |org.openapitools| -|controllerOnly|Whether to generate only API interface stubs without the server files.| |false| |useBeanValidation|Use BeanValidation API annotations| |true| |useInterfaces|Makes the controllerImp implements an interface to facilitate automatic completion when updating from version x to y of your spec| |true| -|handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true| -|wrapCalls|Add a wrapper to each controller function to handle things like metrics, response modification, etc..| |true| |useSwaggerUI|Add a route to /api which show your documentation in swagger-ui. Will also import needed dependencies| |true| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| +|wrapCalls|Add a wrapper to each controller function to handle things like metrics, response modification, etc..| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -84,87 +84,87 @@ sidebar_label: java-play-framework ## LANGUAGE PRIMITIVES -
                                                                                                                                                • Integer
                                                                                                                                                • -
                                                                                                                                                • byte[]
                                                                                                                                                • +
                                                                                                                                                  • Boolean
                                                                                                                                                  • +
                                                                                                                                                  • Double
                                                                                                                                                  • Float
                                                                                                                                                  • -
                                                                                                                                                  • boolean
                                                                                                                                                  • +
                                                                                                                                                  • Integer
                                                                                                                                                  • Long
                                                                                                                                                  • Object
                                                                                                                                                  • String
                                                                                                                                                  • -
                                                                                                                                                  • Boolean
                                                                                                                                                  • -
                                                                                                                                                  • Double
                                                                                                                                                  • +
                                                                                                                                                  • boolean
                                                                                                                                                  • +
                                                                                                                                                  • byte[]
                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                  • localvaraccepts
                                                                                                                                                  • -
                                                                                                                                                  • synchronized
                                                                                                                                                  • -
                                                                                                                                                  • do
                                                                                                                                                  • -
                                                                                                                                                  • float
                                                                                                                                                  • -
                                                                                                                                                  • while
                                                                                                                                                  • -
                                                                                                                                                  • localvarpath
                                                                                                                                                  • -
                                                                                                                                                  • protected
                                                                                                                                                  • -
                                                                                                                                                  • continue
                                                                                                                                                  • -
                                                                                                                                                  • else
                                                                                                                                                  • +
                                                                                                                                                    • abstract
                                                                                                                                                    • apiclient
                                                                                                                                                    • -
                                                                                                                                                    • localvarqueryparams
                                                                                                                                                    • -
                                                                                                                                                    • catch
                                                                                                                                                    • -
                                                                                                                                                    • if
                                                                                                                                                    • +
                                                                                                                                                    • apiexception
                                                                                                                                                    • +
                                                                                                                                                    • apiresponse
                                                                                                                                                    • +
                                                                                                                                                    • assert
                                                                                                                                                    • +
                                                                                                                                                    • boolean
                                                                                                                                                    • +
                                                                                                                                                    • break
                                                                                                                                                    • +
                                                                                                                                                    • byte
                                                                                                                                                    • case
                                                                                                                                                    • -
                                                                                                                                                    • new
                                                                                                                                                    • -
                                                                                                                                                    • package
                                                                                                                                                    • -
                                                                                                                                                    • static
                                                                                                                                                    • -
                                                                                                                                                    • void
                                                                                                                                                    • -
                                                                                                                                                    • localvaraccept
                                                                                                                                                    • +
                                                                                                                                                    • catch
                                                                                                                                                    • +
                                                                                                                                                    • char
                                                                                                                                                    • +
                                                                                                                                                    • class
                                                                                                                                                    • +
                                                                                                                                                    • configuration
                                                                                                                                                    • +
                                                                                                                                                    • const
                                                                                                                                                    • +
                                                                                                                                                    • continue
                                                                                                                                                    • +
                                                                                                                                                    • default
                                                                                                                                                    • +
                                                                                                                                                    • do
                                                                                                                                                    • double
                                                                                                                                                    • -
                                                                                                                                                    • byte
                                                                                                                                                    • -
                                                                                                                                                    • finally
                                                                                                                                                    • -
                                                                                                                                                    • this
                                                                                                                                                    • -
                                                                                                                                                    • strictfp
                                                                                                                                                    • -
                                                                                                                                                    • throws
                                                                                                                                                    • +
                                                                                                                                                    • else
                                                                                                                                                    • enum
                                                                                                                                                    • extends
                                                                                                                                                    • -
                                                                                                                                                    • null
                                                                                                                                                    • -
                                                                                                                                                    • transient
                                                                                                                                                    • -
                                                                                                                                                    • apiexception
                                                                                                                                                    • final
                                                                                                                                                    • -
                                                                                                                                                    • try
                                                                                                                                                    • -
                                                                                                                                                    • object
                                                                                                                                                    • -
                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                    • +
                                                                                                                                                    • finally
                                                                                                                                                    • +
                                                                                                                                                    • float
                                                                                                                                                    • +
                                                                                                                                                    • for
                                                                                                                                                    • +
                                                                                                                                                    • goto
                                                                                                                                                    • +
                                                                                                                                                    • if
                                                                                                                                                    • implements
                                                                                                                                                    • -
                                                                                                                                                    • private
                                                                                                                                                    • import
                                                                                                                                                    • -
                                                                                                                                                    • const
                                                                                                                                                    • -
                                                                                                                                                    • configuration
                                                                                                                                                    • -
                                                                                                                                                    • for
                                                                                                                                                    • -
                                                                                                                                                    • apiresponse
                                                                                                                                                    • +
                                                                                                                                                    • instanceof
                                                                                                                                                    • +
                                                                                                                                                    • int
                                                                                                                                                    • interface
                                                                                                                                                    • -
                                                                                                                                                    • long
                                                                                                                                                    • -
                                                                                                                                                    • switch
                                                                                                                                                    • -
                                                                                                                                                    • default
                                                                                                                                                    • -
                                                                                                                                                    • goto
                                                                                                                                                    • -
                                                                                                                                                    • public
                                                                                                                                                    • -
                                                                                                                                                    • localvarheaderparams
                                                                                                                                                    • -
                                                                                                                                                    • native
                                                                                                                                                    • -
                                                                                                                                                    • localvarcontenttype
                                                                                                                                                    • -
                                                                                                                                                    • assert
                                                                                                                                                    • -
                                                                                                                                                    • stringutil
                                                                                                                                                    • -
                                                                                                                                                    • class
                                                                                                                                                    • +
                                                                                                                                                    • localreturntype
                                                                                                                                                    • +
                                                                                                                                                    • localvaraccept
                                                                                                                                                    • +
                                                                                                                                                    • localvaraccepts
                                                                                                                                                    • +
                                                                                                                                                    • localvarauthnames
                                                                                                                                                    • localvarcollectionqueryparams
                                                                                                                                                    • +
                                                                                                                                                    • localvarcontenttype
                                                                                                                                                    • +
                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                    • localvarcookieparams
                                                                                                                                                    • -
                                                                                                                                                    • localreturntype
                                                                                                                                                    • localvarformparams
                                                                                                                                                    • -
                                                                                                                                                    • break
                                                                                                                                                    • -
                                                                                                                                                    • volatile
                                                                                                                                                    • -
                                                                                                                                                    • localvarauthnames
                                                                                                                                                    • -
                                                                                                                                                    • abstract
                                                                                                                                                    • -
                                                                                                                                                    • int
                                                                                                                                                    • -
                                                                                                                                                    • instanceof
                                                                                                                                                    • -
                                                                                                                                                    • super
                                                                                                                                                    • -
                                                                                                                                                    • boolean
                                                                                                                                                    • -
                                                                                                                                                    • throw
                                                                                                                                                    • +
                                                                                                                                                    • localvarheaderparams
                                                                                                                                                    • +
                                                                                                                                                    • localvarpath
                                                                                                                                                    • localvarpostbody
                                                                                                                                                    • -
                                                                                                                                                    • char
                                                                                                                                                    • -
                                                                                                                                                    • short
                                                                                                                                                    • +
                                                                                                                                                    • localvarqueryparams
                                                                                                                                                    • +
                                                                                                                                                    • long
                                                                                                                                                    • +
                                                                                                                                                    • native
                                                                                                                                                    • +
                                                                                                                                                    • new
                                                                                                                                                    • +
                                                                                                                                                    • null
                                                                                                                                                    • +
                                                                                                                                                    • object
                                                                                                                                                    • +
                                                                                                                                                    • package
                                                                                                                                                    • +
                                                                                                                                                    • private
                                                                                                                                                    • +
                                                                                                                                                    • protected
                                                                                                                                                    • +
                                                                                                                                                    • public
                                                                                                                                                    • return
                                                                                                                                                    • +
                                                                                                                                                    • short
                                                                                                                                                    • +
                                                                                                                                                    • static
                                                                                                                                                    • +
                                                                                                                                                    • strictfp
                                                                                                                                                    • +
                                                                                                                                                    • stringutil
                                                                                                                                                    • +
                                                                                                                                                    • super
                                                                                                                                                    • +
                                                                                                                                                    • switch
                                                                                                                                                    • +
                                                                                                                                                    • synchronized
                                                                                                                                                    • +
                                                                                                                                                    • this
                                                                                                                                                    • +
                                                                                                                                                    • throw
                                                                                                                                                    • +
                                                                                                                                                    • throws
                                                                                                                                                    • +
                                                                                                                                                    • transient
                                                                                                                                                    • +
                                                                                                                                                    • try
                                                                                                                                                    • +
                                                                                                                                                    • void
                                                                                                                                                    • +
                                                                                                                                                    • volatile
                                                                                                                                                    • +
                                                                                                                                                    • while
                                                                                                                                                    diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 1325b002feb3..3e13225d8d4f 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -5,64 +5,64 @@ sidebar_label: java-undertow-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|invokerPackage|root package for generated code| |org.openapitools.handler| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-undertow-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                    **joda**
                                                                                                                                                    Joda (for legacy app only)
                                                                                                                                                    **legacy**
                                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                    **java8-localdatetime**
                                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                    **java8**
                                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                    **threetenbp**
                                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                    **joda**
                                                                                                                                                    Joda (for legacy app only)
                                                                                                                                                    **legacy**
                                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                    **java8-localdatetime**
                                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                    **java8**
                                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                    **threetenbp**
                                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                    |legacy| +|invokerPackage|root package for generated code| |org.openapitools.handler| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                    **true**
                                                                                                                                                    Use Java 8 classes such as Base64
                                                                                                                                                    **false**
                                                                                                                                                    Various third party libraries as needed
                                                                                                                                                    |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |null| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                    **true**
                                                                                                                                                    Use a SnapShot Version
                                                                                                                                                    **false**
                                                                                                                                                    Use a Release Version
                                                                                                                                                    |null| +|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| |src/main/java| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -75,87 +75,87 @@ sidebar_label: java-undertow-server ## LANGUAGE PRIMITIVES -
                                                                                                                                                    • Integer
                                                                                                                                                    • -
                                                                                                                                                    • byte[]
                                                                                                                                                    • +
                                                                                                                                                      • Boolean
                                                                                                                                                      • +
                                                                                                                                                      • Double
                                                                                                                                                      • Float
                                                                                                                                                      • -
                                                                                                                                                      • boolean
                                                                                                                                                      • +
                                                                                                                                                      • Integer
                                                                                                                                                      • Long
                                                                                                                                                      • Object
                                                                                                                                                      • String
                                                                                                                                                      • -
                                                                                                                                                      • Boolean
                                                                                                                                                      • -
                                                                                                                                                      • Double
                                                                                                                                                      • +
                                                                                                                                                      • boolean
                                                                                                                                                      • +
                                                                                                                                                      • byte[]
                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                      • localvaraccepts
                                                                                                                                                      • -
                                                                                                                                                      • synchronized
                                                                                                                                                      • -
                                                                                                                                                      • do
                                                                                                                                                      • -
                                                                                                                                                      • float
                                                                                                                                                      • -
                                                                                                                                                      • while
                                                                                                                                                      • -
                                                                                                                                                      • localvarpath
                                                                                                                                                      • -
                                                                                                                                                      • protected
                                                                                                                                                      • -
                                                                                                                                                      • continue
                                                                                                                                                      • -
                                                                                                                                                      • else
                                                                                                                                                      • +
                                                                                                                                                        • abstract
                                                                                                                                                        • apiclient
                                                                                                                                                        • -
                                                                                                                                                        • localvarqueryparams
                                                                                                                                                        • -
                                                                                                                                                        • catch
                                                                                                                                                        • -
                                                                                                                                                        • if
                                                                                                                                                        • +
                                                                                                                                                        • apiexception
                                                                                                                                                        • +
                                                                                                                                                        • apiresponse
                                                                                                                                                        • +
                                                                                                                                                        • assert
                                                                                                                                                        • +
                                                                                                                                                        • boolean
                                                                                                                                                        • +
                                                                                                                                                        • break
                                                                                                                                                        • +
                                                                                                                                                        • byte
                                                                                                                                                        • case
                                                                                                                                                        • -
                                                                                                                                                        • new
                                                                                                                                                        • -
                                                                                                                                                        • package
                                                                                                                                                        • -
                                                                                                                                                        • static
                                                                                                                                                        • -
                                                                                                                                                        • void
                                                                                                                                                        • -
                                                                                                                                                        • localvaraccept
                                                                                                                                                        • +
                                                                                                                                                        • catch
                                                                                                                                                        • +
                                                                                                                                                        • char
                                                                                                                                                        • +
                                                                                                                                                        • class
                                                                                                                                                        • +
                                                                                                                                                        • configuration
                                                                                                                                                        • +
                                                                                                                                                        • const
                                                                                                                                                        • +
                                                                                                                                                        • continue
                                                                                                                                                        • +
                                                                                                                                                        • default
                                                                                                                                                        • +
                                                                                                                                                        • do
                                                                                                                                                        • double
                                                                                                                                                        • -
                                                                                                                                                        • byte
                                                                                                                                                        • -
                                                                                                                                                        • finally
                                                                                                                                                        • -
                                                                                                                                                        • this
                                                                                                                                                        • -
                                                                                                                                                        • strictfp
                                                                                                                                                        • -
                                                                                                                                                        • throws
                                                                                                                                                        • +
                                                                                                                                                        • else
                                                                                                                                                        • enum
                                                                                                                                                        • extends
                                                                                                                                                        • -
                                                                                                                                                        • null
                                                                                                                                                        • -
                                                                                                                                                        • transient
                                                                                                                                                        • -
                                                                                                                                                        • apiexception
                                                                                                                                                        • final
                                                                                                                                                        • -
                                                                                                                                                        • try
                                                                                                                                                        • -
                                                                                                                                                        • object
                                                                                                                                                        • -
                                                                                                                                                        • localvarcontenttypes
                                                                                                                                                        • +
                                                                                                                                                        • finally
                                                                                                                                                        • +
                                                                                                                                                        • float
                                                                                                                                                        • +
                                                                                                                                                        • for
                                                                                                                                                        • +
                                                                                                                                                        • goto
                                                                                                                                                        • +
                                                                                                                                                        • if
                                                                                                                                                        • implements
                                                                                                                                                        • -
                                                                                                                                                        • private
                                                                                                                                                        • import
                                                                                                                                                        • -
                                                                                                                                                        • const
                                                                                                                                                        • -
                                                                                                                                                        • configuration
                                                                                                                                                        • -
                                                                                                                                                        • for
                                                                                                                                                        • -
                                                                                                                                                        • apiresponse
                                                                                                                                                        • +
                                                                                                                                                        • instanceof
                                                                                                                                                        • +
                                                                                                                                                        • int
                                                                                                                                                        • interface
                                                                                                                                                        • -
                                                                                                                                                        • long
                                                                                                                                                        • -
                                                                                                                                                        • switch
                                                                                                                                                        • -
                                                                                                                                                        • default
                                                                                                                                                        • -
                                                                                                                                                        • goto
                                                                                                                                                        • -
                                                                                                                                                        • public
                                                                                                                                                        • -
                                                                                                                                                        • localvarheaderparams
                                                                                                                                                        • -
                                                                                                                                                        • native
                                                                                                                                                        • -
                                                                                                                                                        • localvarcontenttype
                                                                                                                                                        • -
                                                                                                                                                        • assert
                                                                                                                                                        • -
                                                                                                                                                        • stringutil
                                                                                                                                                        • -
                                                                                                                                                        • class
                                                                                                                                                        • +
                                                                                                                                                        • localreturntype
                                                                                                                                                        • +
                                                                                                                                                        • localvaraccept
                                                                                                                                                        • +
                                                                                                                                                        • localvaraccepts
                                                                                                                                                        • +
                                                                                                                                                        • localvarauthnames
                                                                                                                                                        • localvarcollectionqueryparams
                                                                                                                                                        • +
                                                                                                                                                        • localvarcontenttype
                                                                                                                                                        • +
                                                                                                                                                        • localvarcontenttypes
                                                                                                                                                        • localvarcookieparams
                                                                                                                                                        • -
                                                                                                                                                        • localreturntype
                                                                                                                                                        • localvarformparams
                                                                                                                                                        • -
                                                                                                                                                        • break
                                                                                                                                                        • -
                                                                                                                                                        • volatile
                                                                                                                                                        • -
                                                                                                                                                        • localvarauthnames
                                                                                                                                                        • -
                                                                                                                                                        • abstract
                                                                                                                                                        • -
                                                                                                                                                        • int
                                                                                                                                                        • -
                                                                                                                                                        • instanceof
                                                                                                                                                        • -
                                                                                                                                                        • super
                                                                                                                                                        • -
                                                                                                                                                        • boolean
                                                                                                                                                        • -
                                                                                                                                                        • throw
                                                                                                                                                        • +
                                                                                                                                                        • localvarheaderparams
                                                                                                                                                        • +
                                                                                                                                                        • localvarpath
                                                                                                                                                        • localvarpostbody
                                                                                                                                                        • -
                                                                                                                                                        • char
                                                                                                                                                        • -
                                                                                                                                                        • short
                                                                                                                                                        • +
                                                                                                                                                        • localvarqueryparams
                                                                                                                                                        • +
                                                                                                                                                        • long
                                                                                                                                                        • +
                                                                                                                                                        • native
                                                                                                                                                        • +
                                                                                                                                                        • new
                                                                                                                                                        • +
                                                                                                                                                        • null
                                                                                                                                                        • +
                                                                                                                                                        • object
                                                                                                                                                        • +
                                                                                                                                                        • package
                                                                                                                                                        • +
                                                                                                                                                        • private
                                                                                                                                                        • +
                                                                                                                                                        • protected
                                                                                                                                                        • +
                                                                                                                                                        • public
                                                                                                                                                        • return
                                                                                                                                                        • +
                                                                                                                                                        • short
                                                                                                                                                        • +
                                                                                                                                                        • static
                                                                                                                                                        • +
                                                                                                                                                        • strictfp
                                                                                                                                                        • +
                                                                                                                                                        • stringutil
                                                                                                                                                        • +
                                                                                                                                                        • super
                                                                                                                                                        • +
                                                                                                                                                        • switch
                                                                                                                                                        • +
                                                                                                                                                        • synchronized
                                                                                                                                                        • +
                                                                                                                                                        • this
                                                                                                                                                        • +
                                                                                                                                                        • throw
                                                                                                                                                        • +
                                                                                                                                                        • throws
                                                                                                                                                        • +
                                                                                                                                                        • transient
                                                                                                                                                        • +
                                                                                                                                                        • try
                                                                                                                                                        • +
                                                                                                                                                        • void
                                                                                                                                                        • +
                                                                                                                                                        • volatile
                                                                                                                                                        • +
                                                                                                                                                        • while
                                                                                                                                                        diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 4c40dfc2a888..584fae2dc242 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -5,64 +5,64 @@ sidebar_label: java-vertx-web | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.vertxweb.server.model| |apiPackage|package for generated api classes| |org.openapitools.vertxweb.server.api| -|invokerPackage|root package for generated code| |org.openapitools.vertxweb.server| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-vertx-web-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                        **joda**
                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                        **legacy**
                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                        **java8**
                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                        **threetenbp**
                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                        |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                        **joda**
                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                        **legacy**
                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                        **java8**
                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                        **threetenbp**
                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                        |java8| +|invokerPackage|root package for generated code| |org.openapitools.vertxweb.server| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                        **true**
                                                                                                                                                        Use Java 8 classes such as Base64
                                                                                                                                                        **false**
                                                                                                                                                        Various third party libraries as needed
                                                                                                                                                        |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.vertxweb.server.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                        **true**
                                                                                                                                                        Use a SnapShot Version
                                                                                                                                                        **false**
                                                                                                                                                        Use a Release Version
                                                                                                                                                        |null| +|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| |src/main/java| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -75,87 +75,87 @@ sidebar_label: java-vertx-web ## LANGUAGE PRIMITIVES -
                                                                                                                                                        • Integer
                                                                                                                                                        • -
                                                                                                                                                        • byte[]
                                                                                                                                                        • +
                                                                                                                                                          • Boolean
                                                                                                                                                          • +
                                                                                                                                                          • Double
                                                                                                                                                          • Float
                                                                                                                                                          • -
                                                                                                                                                          • boolean
                                                                                                                                                          • +
                                                                                                                                                          • Integer
                                                                                                                                                          • Long
                                                                                                                                                          • Object
                                                                                                                                                          • String
                                                                                                                                                          • -
                                                                                                                                                          • Boolean
                                                                                                                                                          • -
                                                                                                                                                          • Double
                                                                                                                                                          • +
                                                                                                                                                          • boolean
                                                                                                                                                          • +
                                                                                                                                                          • byte[]
                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                          • localvaraccepts
                                                                                                                                                          • -
                                                                                                                                                          • synchronized
                                                                                                                                                          • -
                                                                                                                                                          • do
                                                                                                                                                          • -
                                                                                                                                                          • float
                                                                                                                                                          • -
                                                                                                                                                          • while
                                                                                                                                                          • -
                                                                                                                                                          • localvarpath
                                                                                                                                                          • -
                                                                                                                                                          • protected
                                                                                                                                                          • -
                                                                                                                                                          • continue
                                                                                                                                                          • -
                                                                                                                                                          • else
                                                                                                                                                          • +
                                                                                                                                                            • abstract
                                                                                                                                                            • apiclient
                                                                                                                                                            • -
                                                                                                                                                            • localvarqueryparams
                                                                                                                                                            • -
                                                                                                                                                            • catch
                                                                                                                                                            • -
                                                                                                                                                            • if
                                                                                                                                                            • +
                                                                                                                                                            • apiexception
                                                                                                                                                            • +
                                                                                                                                                            • apiresponse
                                                                                                                                                            • +
                                                                                                                                                            • assert
                                                                                                                                                            • +
                                                                                                                                                            • boolean
                                                                                                                                                            • +
                                                                                                                                                            • break
                                                                                                                                                            • +
                                                                                                                                                            • byte
                                                                                                                                                            • case
                                                                                                                                                            • -
                                                                                                                                                            • new
                                                                                                                                                            • -
                                                                                                                                                            • package
                                                                                                                                                            • -
                                                                                                                                                            • static
                                                                                                                                                            • -
                                                                                                                                                            • void
                                                                                                                                                            • -
                                                                                                                                                            • localvaraccept
                                                                                                                                                            • +
                                                                                                                                                            • catch
                                                                                                                                                            • +
                                                                                                                                                            • char
                                                                                                                                                            • +
                                                                                                                                                            • class
                                                                                                                                                            • +
                                                                                                                                                            • configuration
                                                                                                                                                            • +
                                                                                                                                                            • const
                                                                                                                                                            • +
                                                                                                                                                            • continue
                                                                                                                                                            • +
                                                                                                                                                            • default
                                                                                                                                                            • +
                                                                                                                                                            • do
                                                                                                                                                            • double
                                                                                                                                                            • -
                                                                                                                                                            • byte
                                                                                                                                                            • -
                                                                                                                                                            • finally
                                                                                                                                                            • -
                                                                                                                                                            • this
                                                                                                                                                            • -
                                                                                                                                                            • strictfp
                                                                                                                                                            • -
                                                                                                                                                            • throws
                                                                                                                                                            • +
                                                                                                                                                            • else
                                                                                                                                                            • enum
                                                                                                                                                            • extends
                                                                                                                                                            • -
                                                                                                                                                            • null
                                                                                                                                                            • -
                                                                                                                                                            • transient
                                                                                                                                                            • -
                                                                                                                                                            • apiexception
                                                                                                                                                            • final
                                                                                                                                                            • -
                                                                                                                                                            • try
                                                                                                                                                            • -
                                                                                                                                                            • object
                                                                                                                                                            • -
                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                            • +
                                                                                                                                                            • finally
                                                                                                                                                            • +
                                                                                                                                                            • float
                                                                                                                                                            • +
                                                                                                                                                            • for
                                                                                                                                                            • +
                                                                                                                                                            • goto
                                                                                                                                                            • +
                                                                                                                                                            • if
                                                                                                                                                            • implements
                                                                                                                                                            • -
                                                                                                                                                            • private
                                                                                                                                                            • import
                                                                                                                                                            • -
                                                                                                                                                            • const
                                                                                                                                                            • -
                                                                                                                                                            • configuration
                                                                                                                                                            • -
                                                                                                                                                            • for
                                                                                                                                                            • -
                                                                                                                                                            • apiresponse
                                                                                                                                                            • +
                                                                                                                                                            • instanceof
                                                                                                                                                            • +
                                                                                                                                                            • int
                                                                                                                                                            • interface
                                                                                                                                                            • -
                                                                                                                                                            • long
                                                                                                                                                            • -
                                                                                                                                                            • switch
                                                                                                                                                            • -
                                                                                                                                                            • default
                                                                                                                                                            • -
                                                                                                                                                            • goto
                                                                                                                                                            • -
                                                                                                                                                            • public
                                                                                                                                                            • -
                                                                                                                                                            • localvarheaderparams
                                                                                                                                                            • -
                                                                                                                                                            • native
                                                                                                                                                            • -
                                                                                                                                                            • localvarcontenttype
                                                                                                                                                            • -
                                                                                                                                                            • assert
                                                                                                                                                            • -
                                                                                                                                                            • stringutil
                                                                                                                                                            • -
                                                                                                                                                            • class
                                                                                                                                                            • +
                                                                                                                                                            • localreturntype
                                                                                                                                                            • +
                                                                                                                                                            • localvaraccept
                                                                                                                                                            • +
                                                                                                                                                            • localvaraccepts
                                                                                                                                                            • +
                                                                                                                                                            • localvarauthnames
                                                                                                                                                            • localvarcollectionqueryparams
                                                                                                                                                            • +
                                                                                                                                                            • localvarcontenttype
                                                                                                                                                            • +
                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                            • localvarcookieparams
                                                                                                                                                            • -
                                                                                                                                                            • localreturntype
                                                                                                                                                            • localvarformparams
                                                                                                                                                            • -
                                                                                                                                                            • break
                                                                                                                                                            • -
                                                                                                                                                            • volatile
                                                                                                                                                            • -
                                                                                                                                                            • localvarauthnames
                                                                                                                                                            • -
                                                                                                                                                            • abstract
                                                                                                                                                            • -
                                                                                                                                                            • int
                                                                                                                                                            • -
                                                                                                                                                            • instanceof
                                                                                                                                                            • -
                                                                                                                                                            • super
                                                                                                                                                            • -
                                                                                                                                                            • boolean
                                                                                                                                                            • -
                                                                                                                                                            • throw
                                                                                                                                                            • +
                                                                                                                                                            • localvarheaderparams
                                                                                                                                                            • +
                                                                                                                                                            • localvarpath
                                                                                                                                                            • localvarpostbody
                                                                                                                                                            • -
                                                                                                                                                            • char
                                                                                                                                                            • -
                                                                                                                                                            • short
                                                                                                                                                            • +
                                                                                                                                                            • localvarqueryparams
                                                                                                                                                            • +
                                                                                                                                                            • long
                                                                                                                                                            • +
                                                                                                                                                            • native
                                                                                                                                                            • +
                                                                                                                                                            • new
                                                                                                                                                            • +
                                                                                                                                                            • null
                                                                                                                                                            • +
                                                                                                                                                            • object
                                                                                                                                                            • +
                                                                                                                                                            • package
                                                                                                                                                            • +
                                                                                                                                                            • private
                                                                                                                                                            • +
                                                                                                                                                            • protected
                                                                                                                                                            • +
                                                                                                                                                            • public
                                                                                                                                                            • return
                                                                                                                                                            • +
                                                                                                                                                            • short
                                                                                                                                                            • +
                                                                                                                                                            • static
                                                                                                                                                            • +
                                                                                                                                                            • strictfp
                                                                                                                                                            • +
                                                                                                                                                            • stringutil
                                                                                                                                                            • +
                                                                                                                                                            • super
                                                                                                                                                            • +
                                                                                                                                                            • switch
                                                                                                                                                            • +
                                                                                                                                                            • synchronized
                                                                                                                                                            • +
                                                                                                                                                            • this
                                                                                                                                                            • +
                                                                                                                                                            • throw
                                                                                                                                                            • +
                                                                                                                                                            • throws
                                                                                                                                                            • +
                                                                                                                                                            • transient
                                                                                                                                                            • +
                                                                                                                                                            • try
                                                                                                                                                            • +
                                                                                                                                                            • void
                                                                                                                                                            • +
                                                                                                                                                            • volatile
                                                                                                                                                            • +
                                                                                                                                                            • while
                                                                                                                                                            diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 4ad79ef3cf69..ea93520b0be3 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -5,67 +5,67 @@ sidebar_label: java-vertx | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.server.api.model| |apiPackage|package for generated api classes| |org.openapitools.server.api.verticle| -|invokerPackage|root package for generated code| |org.openapitools| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-vertx-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0-SNAPSHOT| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                            **joda**
                                                                                                                                                            Joda (for legacy app only)
                                                                                                                                                            **legacy**
                                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                            **java8-localdatetime**
                                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                            **java8**
                                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                            **threetenbp**
                                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                            |java8| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                            **joda**
                                                                                                                                                            Joda (for legacy app only)
                                                                                                                                                            **legacy**
                                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                            **java8-localdatetime**
                                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                            **java8**
                                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                            **threetenbp**
                                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                            |java8| +|invokerPackage|root package for generated code| |org.openapitools| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                            **true**
                                                                                                                                                            Use Java 8 classes such as Base64
                                                                                                                                                            **false**
                                                                                                                                                            Various third party libraries as needed
                                                                                                                                                            |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.server.api.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| -|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                            **true**
                                                                                                                                                            Use a SnapShot Version
                                                                                                                                                            **false**
                                                                                                                                                            Use a Release Version
                                                                                                                                                            |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |rxInterface|When specified, API interfaces are generated with RX and methods return Single<> and Comparable.| |false| |rxVersion2|When specified in combination with rxInterface, API interfaces are generated with RxJava2.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                            **true**
                                                                                                                                                            Use a SnapShot Version
                                                                                                                                                            **false**
                                                                                                                                                            Use a Release Version
                                                                                                                                                            |null| +|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| |src/main/java| |vertxSwaggerRouterVersion|Specify the version of the swagger router library| |null| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -78,87 +78,87 @@ sidebar_label: java-vertx ## LANGUAGE PRIMITIVES -
                                                                                                                                                            • Integer
                                                                                                                                                            • -
                                                                                                                                                            • byte[]
                                                                                                                                                            • +
                                                                                                                                                              • Boolean
                                                                                                                                                              • +
                                                                                                                                                              • Double
                                                                                                                                                              • Float
                                                                                                                                                              • -
                                                                                                                                                              • boolean
                                                                                                                                                              • +
                                                                                                                                                              • Integer
                                                                                                                                                              • Long
                                                                                                                                                              • Object
                                                                                                                                                              • String
                                                                                                                                                              • -
                                                                                                                                                              • Boolean
                                                                                                                                                              • -
                                                                                                                                                              • Double
                                                                                                                                                              • +
                                                                                                                                                              • boolean
                                                                                                                                                              • +
                                                                                                                                                              • byte[]
                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                              • localvaraccepts
                                                                                                                                                              • -
                                                                                                                                                              • synchronized
                                                                                                                                                              • -
                                                                                                                                                              • do
                                                                                                                                                              • -
                                                                                                                                                              • float
                                                                                                                                                              • -
                                                                                                                                                              • while
                                                                                                                                                              • -
                                                                                                                                                              • localvarpath
                                                                                                                                                              • -
                                                                                                                                                              • protected
                                                                                                                                                              • -
                                                                                                                                                              • continue
                                                                                                                                                              • -
                                                                                                                                                              • else
                                                                                                                                                              • +
                                                                                                                                                                • abstract
                                                                                                                                                                • apiclient
                                                                                                                                                                • -
                                                                                                                                                                • localvarqueryparams
                                                                                                                                                                • -
                                                                                                                                                                • catch
                                                                                                                                                                • -
                                                                                                                                                                • if
                                                                                                                                                                • +
                                                                                                                                                                • apiexception
                                                                                                                                                                • +
                                                                                                                                                                • apiresponse
                                                                                                                                                                • +
                                                                                                                                                                • assert
                                                                                                                                                                • +
                                                                                                                                                                • boolean
                                                                                                                                                                • +
                                                                                                                                                                • break
                                                                                                                                                                • +
                                                                                                                                                                • byte
                                                                                                                                                                • case
                                                                                                                                                                • -
                                                                                                                                                                • new
                                                                                                                                                                • -
                                                                                                                                                                • package
                                                                                                                                                                • -
                                                                                                                                                                • static
                                                                                                                                                                • -
                                                                                                                                                                • void
                                                                                                                                                                • -
                                                                                                                                                                • localvaraccept
                                                                                                                                                                • +
                                                                                                                                                                • catch
                                                                                                                                                                • +
                                                                                                                                                                • char
                                                                                                                                                                • +
                                                                                                                                                                • class
                                                                                                                                                                • +
                                                                                                                                                                • configuration
                                                                                                                                                                • +
                                                                                                                                                                • const
                                                                                                                                                                • +
                                                                                                                                                                • continue
                                                                                                                                                                • +
                                                                                                                                                                • default
                                                                                                                                                                • +
                                                                                                                                                                • do
                                                                                                                                                                • double
                                                                                                                                                                • -
                                                                                                                                                                • byte
                                                                                                                                                                • -
                                                                                                                                                                • finally
                                                                                                                                                                • -
                                                                                                                                                                • this
                                                                                                                                                                • -
                                                                                                                                                                • strictfp
                                                                                                                                                                • -
                                                                                                                                                                • throws
                                                                                                                                                                • +
                                                                                                                                                                • else
                                                                                                                                                                • enum
                                                                                                                                                                • extends
                                                                                                                                                                • -
                                                                                                                                                                • null
                                                                                                                                                                • -
                                                                                                                                                                • transient
                                                                                                                                                                • -
                                                                                                                                                                • apiexception
                                                                                                                                                                • final
                                                                                                                                                                • -
                                                                                                                                                                • try
                                                                                                                                                                • -
                                                                                                                                                                • object
                                                                                                                                                                • -
                                                                                                                                                                • localvarcontenttypes
                                                                                                                                                                • +
                                                                                                                                                                • finally
                                                                                                                                                                • +
                                                                                                                                                                • float
                                                                                                                                                                • +
                                                                                                                                                                • for
                                                                                                                                                                • +
                                                                                                                                                                • goto
                                                                                                                                                                • +
                                                                                                                                                                • if
                                                                                                                                                                • implements
                                                                                                                                                                • -
                                                                                                                                                                • private
                                                                                                                                                                • import
                                                                                                                                                                • -
                                                                                                                                                                • const
                                                                                                                                                                • -
                                                                                                                                                                • configuration
                                                                                                                                                                • -
                                                                                                                                                                • for
                                                                                                                                                                • -
                                                                                                                                                                • apiresponse
                                                                                                                                                                • +
                                                                                                                                                                • instanceof
                                                                                                                                                                • +
                                                                                                                                                                • int
                                                                                                                                                                • interface
                                                                                                                                                                • -
                                                                                                                                                                • long
                                                                                                                                                                • -
                                                                                                                                                                • switch
                                                                                                                                                                • -
                                                                                                                                                                • default
                                                                                                                                                                • -
                                                                                                                                                                • goto
                                                                                                                                                                • -
                                                                                                                                                                • public
                                                                                                                                                                • -
                                                                                                                                                                • localvarheaderparams
                                                                                                                                                                • -
                                                                                                                                                                • native
                                                                                                                                                                • -
                                                                                                                                                                • localvarcontenttype
                                                                                                                                                                • -
                                                                                                                                                                • assert
                                                                                                                                                                • -
                                                                                                                                                                • stringutil
                                                                                                                                                                • -
                                                                                                                                                                • class
                                                                                                                                                                • +
                                                                                                                                                                • localreturntype
                                                                                                                                                                • +
                                                                                                                                                                • localvaraccept
                                                                                                                                                                • +
                                                                                                                                                                • localvaraccepts
                                                                                                                                                                • +
                                                                                                                                                                • localvarauthnames
                                                                                                                                                                • localvarcollectionqueryparams
                                                                                                                                                                • +
                                                                                                                                                                • localvarcontenttype
                                                                                                                                                                • +
                                                                                                                                                                • localvarcontenttypes
                                                                                                                                                                • localvarcookieparams
                                                                                                                                                                • -
                                                                                                                                                                • localreturntype
                                                                                                                                                                • localvarformparams
                                                                                                                                                                • -
                                                                                                                                                                • break
                                                                                                                                                                • -
                                                                                                                                                                • volatile
                                                                                                                                                                • -
                                                                                                                                                                • localvarauthnames
                                                                                                                                                                • -
                                                                                                                                                                • abstract
                                                                                                                                                                • -
                                                                                                                                                                • int
                                                                                                                                                                • -
                                                                                                                                                                • instanceof
                                                                                                                                                                • -
                                                                                                                                                                • super
                                                                                                                                                                • -
                                                                                                                                                                • boolean
                                                                                                                                                                • -
                                                                                                                                                                • throw
                                                                                                                                                                • +
                                                                                                                                                                • localvarheaderparams
                                                                                                                                                                • +
                                                                                                                                                                • localvarpath
                                                                                                                                                                • localvarpostbody
                                                                                                                                                                • -
                                                                                                                                                                • char
                                                                                                                                                                • -
                                                                                                                                                                • short
                                                                                                                                                                • +
                                                                                                                                                                • localvarqueryparams
                                                                                                                                                                • +
                                                                                                                                                                • long
                                                                                                                                                                • +
                                                                                                                                                                • native
                                                                                                                                                                • +
                                                                                                                                                                • new
                                                                                                                                                                • +
                                                                                                                                                                • null
                                                                                                                                                                • +
                                                                                                                                                                • object
                                                                                                                                                                • +
                                                                                                                                                                • package
                                                                                                                                                                • +
                                                                                                                                                                • private
                                                                                                                                                                • +
                                                                                                                                                                • protected
                                                                                                                                                                • +
                                                                                                                                                                • public
                                                                                                                                                                • return
                                                                                                                                                                • +
                                                                                                                                                                • short
                                                                                                                                                                • +
                                                                                                                                                                • static
                                                                                                                                                                • +
                                                                                                                                                                • strictfp
                                                                                                                                                                • +
                                                                                                                                                                • stringutil
                                                                                                                                                                • +
                                                                                                                                                                • super
                                                                                                                                                                • +
                                                                                                                                                                • switch
                                                                                                                                                                • +
                                                                                                                                                                • synchronized
                                                                                                                                                                • +
                                                                                                                                                                • this
                                                                                                                                                                • +
                                                                                                                                                                • throw
                                                                                                                                                                • +
                                                                                                                                                                • throws
                                                                                                                                                                • +
                                                                                                                                                                • transient
                                                                                                                                                                • +
                                                                                                                                                                • try
                                                                                                                                                                • +
                                                                                                                                                                • void
                                                                                                                                                                • +
                                                                                                                                                                • volatile
                                                                                                                                                                • +
                                                                                                                                                                • while
                                                                                                                                                                diff --git a/docs/generators/java.md b/docs/generators/java.md index 9f8e76882467..fddd7ba9ff97 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -5,79 +5,79 @@ sidebar_label: java | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.client.model| |apiPackage|package for generated api classes| |org.openapitools.client.api| -|invokerPackage|root package for generated code| |org.openapitools.client| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-client| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                **joda**
                                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                                **legacy**
                                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                **java8-localdatetime**
                                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                **java8**
                                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                **threetenbp**
                                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                |threetenbp| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|feignVersion|Version of OpenFeign: '10.x', '9.x' (default)| |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                **joda**
                                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                                **legacy**
                                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                **java8-localdatetime**
                                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                **java8**
                                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                **threetenbp**
                                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                |threetenbp| +|invokerPackage|root package for generated code| |org.openapitools.client| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                **true**
                                                                                                                                                                Use Java 8 classes such as Base64
                                                                                                                                                                **false**
                                                                                                                                                                Various third party libraries as needed
                                                                                                                                                                |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|library|library template (sub-template) to use|
                                                                                                                                                                **jersey1**
                                                                                                                                                                HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
                                                                                                                                                                **jersey2**
                                                                                                                                                                HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
                                                                                                                                                                **feign**
                                                                                                                                                                HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.9.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'
                                                                                                                                                                **okhttp-gson**
                                                                                                                                                                [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
                                                                                                                                                                **retrofit**
                                                                                                                                                                HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
                                                                                                                                                                **retrofit2**
                                                                                                                                                                HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
                                                                                                                                                                **resttemplate**
                                                                                                                                                                HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **webclient**
                                                                                                                                                                HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **resteasy**
                                                                                                                                                                HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **vertx**
                                                                                                                                                                HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **google-api-client**
                                                                                                                                                                HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **rest-assured**
                                                                                                                                                                HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8
                                                                                                                                                                **native**
                                                                                                                                                                HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
                                                                                                                                                                **microprofile**
                                                                                                                                                                HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                |okhttp-gson| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.client.model| +|parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| -|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                **true**
                                                                                                                                                                Use a SnapShot Version
                                                                                                                                                                **false**
                                                                                                                                                                Use a Release Version
                                                                                                                                                                |null| -|useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false| -|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false| -|parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false| -|usePlayWS|Use Play! Async HTTP client (Play WS API)| |false| +|performBeanValidation|Perform BeanValidation| |false| |playVersion|Version of Play! Framework (possible values "play24", "play25" (default), "play26")| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serializationLibrary|Serialization library, default depends from the library|
                                                                                                                                                                **jackson**
                                                                                                                                                                Use Jackson as serialization library
                                                                                                                                                                **gson**
                                                                                                                                                                Use Gson as serialization library
                                                                                                                                                                |null| +|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                **true**
                                                                                                                                                                Use a SnapShot Version
                                                                                                                                                                **false**
                                                                                                                                                                Use a Release Version
                                                                                                                                                                |null| +|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| |src/main/java| |supportJava6|Whether to support Java6 with the Jersey1 library.| |false| |useBeanValidation|Use BeanValidation API annotations| |false| -|performBeanValidation|Perform BeanValidation| |false| |useGzipFeature|Send gzip-encoded requests| |false| -|useRuntimeException|Use RuntimeException instead of Exception| |false| -|feignVersion|Version of OpenFeign: '10.x', '9.x' (default)| |false| +|usePlayWS|Use Play! Async HTTP client (Play WS API)| |false| |useReflectionEqualsHashCode|Use org.apache.commons.lang3.builder for equals and hashCode in the models. WARNING: This will fail under a security manager, unless the appropriate permissions are set up correctly and also there's potential performance impact.| |false| -|caseInsensitiveResponseHeaders|Make API response's headers case-insensitive. Available on okhttp-gson, jersey2 libraries| |false| -|library|library template (sub-template) to use|
                                                                                                                                                                **jersey1**
                                                                                                                                                                HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
                                                                                                                                                                **jersey2**
                                                                                                                                                                HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
                                                                                                                                                                **feign**
                                                                                                                                                                HTTP client: OpenFeign 9.x or 10.x. JSON processing: Jackson 2.9.x. To enable OpenFeign 10.x, set the 'feignVersion' option to '10.x'
                                                                                                                                                                **okhttp-gson**
                                                                                                                                                                [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
                                                                                                                                                                **retrofit**
                                                                                                                                                                HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
                                                                                                                                                                **retrofit2**
                                                                                                                                                                HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
                                                                                                                                                                **resttemplate**
                                                                                                                                                                HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **webclient**
                                                                                                                                                                HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **resteasy**
                                                                                                                                                                HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **vertx**
                                                                                                                                                                HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **google-api-client**
                                                                                                                                                                HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                **rest-assured**
                                                                                                                                                                HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.9.x. Only for Java8
                                                                                                                                                                **native**
                                                                                                                                                                HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
                                                                                                                                                                **microprofile**
                                                                                                                                                                HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x
                                                                                                                                                                |okhttp-gson| -|serializationLibrary|Serialization library, default depends from the library|
                                                                                                                                                                **jackson**
                                                                                                                                                                Use Jackson as serialization library
                                                                                                                                                                **gson**
                                                                                                                                                                Use Gson as serialization library
                                                                                                                                                                |null| +|useRuntimeException|Use RuntimeException instead of Exception| |false| +|useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false| +|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -90,87 +90,87 @@ sidebar_label: java ## LANGUAGE PRIMITIVES -
                                                                                                                                                                • Integer
                                                                                                                                                                • -
                                                                                                                                                                • byte[]
                                                                                                                                                                • +
                                                                                                                                                                  • Boolean
                                                                                                                                                                  • +
                                                                                                                                                                  • Double
                                                                                                                                                                  • Float
                                                                                                                                                                  • -
                                                                                                                                                                  • boolean
                                                                                                                                                                  • +
                                                                                                                                                                  • Integer
                                                                                                                                                                  • Long
                                                                                                                                                                  • Object
                                                                                                                                                                  • String
                                                                                                                                                                  • -
                                                                                                                                                                  • Boolean
                                                                                                                                                                  • -
                                                                                                                                                                  • Double
                                                                                                                                                                  • +
                                                                                                                                                                  • boolean
                                                                                                                                                                  • +
                                                                                                                                                                  • byte[]
                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                  • localvaraccepts
                                                                                                                                                                  • -
                                                                                                                                                                  • synchronized
                                                                                                                                                                  • -
                                                                                                                                                                  • do
                                                                                                                                                                  • -
                                                                                                                                                                  • float
                                                                                                                                                                  • -
                                                                                                                                                                  • while
                                                                                                                                                                  • -
                                                                                                                                                                  • localvarpath
                                                                                                                                                                  • -
                                                                                                                                                                  • protected
                                                                                                                                                                  • -
                                                                                                                                                                  • continue
                                                                                                                                                                  • -
                                                                                                                                                                  • else
                                                                                                                                                                  • +
                                                                                                                                                                    • abstract
                                                                                                                                                                    • apiclient
                                                                                                                                                                    • -
                                                                                                                                                                    • localvarqueryparams
                                                                                                                                                                    • -
                                                                                                                                                                    • catch
                                                                                                                                                                    • -
                                                                                                                                                                    • if
                                                                                                                                                                    • +
                                                                                                                                                                    • apiexception
                                                                                                                                                                    • +
                                                                                                                                                                    • apiresponse
                                                                                                                                                                    • +
                                                                                                                                                                    • assert
                                                                                                                                                                    • +
                                                                                                                                                                    • boolean
                                                                                                                                                                    • +
                                                                                                                                                                    • break
                                                                                                                                                                    • +
                                                                                                                                                                    • byte
                                                                                                                                                                    • case
                                                                                                                                                                    • -
                                                                                                                                                                    • new
                                                                                                                                                                    • -
                                                                                                                                                                    • package
                                                                                                                                                                    • -
                                                                                                                                                                    • static
                                                                                                                                                                    • -
                                                                                                                                                                    • void
                                                                                                                                                                    • -
                                                                                                                                                                    • localvaraccept
                                                                                                                                                                    • +
                                                                                                                                                                    • catch
                                                                                                                                                                    • +
                                                                                                                                                                    • char
                                                                                                                                                                    • +
                                                                                                                                                                    • class
                                                                                                                                                                    • +
                                                                                                                                                                    • configuration
                                                                                                                                                                    • +
                                                                                                                                                                    • const
                                                                                                                                                                    • +
                                                                                                                                                                    • continue
                                                                                                                                                                    • +
                                                                                                                                                                    • default
                                                                                                                                                                    • +
                                                                                                                                                                    • do
                                                                                                                                                                    • double
                                                                                                                                                                    • -
                                                                                                                                                                    • byte
                                                                                                                                                                    • -
                                                                                                                                                                    • finally
                                                                                                                                                                    • -
                                                                                                                                                                    • this
                                                                                                                                                                    • -
                                                                                                                                                                    • strictfp
                                                                                                                                                                    • -
                                                                                                                                                                    • throws
                                                                                                                                                                    • +
                                                                                                                                                                    • else
                                                                                                                                                                    • enum
                                                                                                                                                                    • extends
                                                                                                                                                                    • -
                                                                                                                                                                    • null
                                                                                                                                                                    • -
                                                                                                                                                                    • transient
                                                                                                                                                                    • -
                                                                                                                                                                    • apiexception
                                                                                                                                                                    • final
                                                                                                                                                                    • -
                                                                                                                                                                    • try
                                                                                                                                                                    • -
                                                                                                                                                                    • object
                                                                                                                                                                    • -
                                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                                    • +
                                                                                                                                                                    • finally
                                                                                                                                                                    • +
                                                                                                                                                                    • float
                                                                                                                                                                    • +
                                                                                                                                                                    • for
                                                                                                                                                                    • +
                                                                                                                                                                    • goto
                                                                                                                                                                    • +
                                                                                                                                                                    • if
                                                                                                                                                                    • implements
                                                                                                                                                                    • -
                                                                                                                                                                    • private
                                                                                                                                                                    • import
                                                                                                                                                                    • -
                                                                                                                                                                    • const
                                                                                                                                                                    • -
                                                                                                                                                                    • configuration
                                                                                                                                                                    • -
                                                                                                                                                                    • for
                                                                                                                                                                    • -
                                                                                                                                                                    • apiresponse
                                                                                                                                                                    • +
                                                                                                                                                                    • instanceof
                                                                                                                                                                    • +
                                                                                                                                                                    • int
                                                                                                                                                                    • interface
                                                                                                                                                                    • -
                                                                                                                                                                    • long
                                                                                                                                                                    • -
                                                                                                                                                                    • switch
                                                                                                                                                                    • -
                                                                                                                                                                    • default
                                                                                                                                                                    • -
                                                                                                                                                                    • goto
                                                                                                                                                                    • -
                                                                                                                                                                    • public
                                                                                                                                                                    • -
                                                                                                                                                                    • localvarheaderparams
                                                                                                                                                                    • -
                                                                                                                                                                    • native
                                                                                                                                                                    • -
                                                                                                                                                                    • localvarcontenttype
                                                                                                                                                                    • -
                                                                                                                                                                    • assert
                                                                                                                                                                    • -
                                                                                                                                                                    • stringutil
                                                                                                                                                                    • -
                                                                                                                                                                    • class
                                                                                                                                                                    • +
                                                                                                                                                                    • localreturntype
                                                                                                                                                                    • +
                                                                                                                                                                    • localvaraccept
                                                                                                                                                                    • +
                                                                                                                                                                    • localvaraccepts
                                                                                                                                                                    • +
                                                                                                                                                                    • localvarauthnames
                                                                                                                                                                    • localvarcollectionqueryparams
                                                                                                                                                                    • +
                                                                                                                                                                    • localvarcontenttype
                                                                                                                                                                    • +
                                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                                    • localvarcookieparams
                                                                                                                                                                    • -
                                                                                                                                                                    • localreturntype
                                                                                                                                                                    • localvarformparams
                                                                                                                                                                    • -
                                                                                                                                                                    • break
                                                                                                                                                                    • -
                                                                                                                                                                    • volatile
                                                                                                                                                                    • -
                                                                                                                                                                    • localvarauthnames
                                                                                                                                                                    • -
                                                                                                                                                                    • abstract
                                                                                                                                                                    • -
                                                                                                                                                                    • int
                                                                                                                                                                    • -
                                                                                                                                                                    • instanceof
                                                                                                                                                                    • -
                                                                                                                                                                    • super
                                                                                                                                                                    • -
                                                                                                                                                                    • boolean
                                                                                                                                                                    • -
                                                                                                                                                                    • throw
                                                                                                                                                                    • +
                                                                                                                                                                    • localvarheaderparams
                                                                                                                                                                    • +
                                                                                                                                                                    • localvarpath
                                                                                                                                                                    • localvarpostbody
                                                                                                                                                                    • -
                                                                                                                                                                    • char
                                                                                                                                                                    • -
                                                                                                                                                                    • short
                                                                                                                                                                    • +
                                                                                                                                                                    • localvarqueryparams
                                                                                                                                                                    • +
                                                                                                                                                                    • long
                                                                                                                                                                    • +
                                                                                                                                                                    • native
                                                                                                                                                                    • +
                                                                                                                                                                    • new
                                                                                                                                                                    • +
                                                                                                                                                                    • null
                                                                                                                                                                    • +
                                                                                                                                                                    • object
                                                                                                                                                                    • +
                                                                                                                                                                    • package
                                                                                                                                                                    • +
                                                                                                                                                                    • private
                                                                                                                                                                    • +
                                                                                                                                                                    • protected
                                                                                                                                                                    • +
                                                                                                                                                                    • public
                                                                                                                                                                    • return
                                                                                                                                                                    • +
                                                                                                                                                                    • short
                                                                                                                                                                    • +
                                                                                                                                                                    • static
                                                                                                                                                                    • +
                                                                                                                                                                    • strictfp
                                                                                                                                                                    • +
                                                                                                                                                                    • stringutil
                                                                                                                                                                    • +
                                                                                                                                                                    • super
                                                                                                                                                                    • +
                                                                                                                                                                    • switch
                                                                                                                                                                    • +
                                                                                                                                                                    • synchronized
                                                                                                                                                                    • +
                                                                                                                                                                    • this
                                                                                                                                                                    • +
                                                                                                                                                                    • throw
                                                                                                                                                                    • +
                                                                                                                                                                    • throws
                                                                                                                                                                    • +
                                                                                                                                                                    • transient
                                                                                                                                                                    • +
                                                                                                                                                                    • try
                                                                                                                                                                    • +
                                                                                                                                                                    • void
                                                                                                                                                                    • +
                                                                                                                                                                    • volatile
                                                                                                                                                                    • +
                                                                                                                                                                    • while
                                                                                                                                                                    diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 33cb0cde470a..0308a0a824cf 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -5,12 +5,12 @@ sidebar_label: javascript-closure-angular | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|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| |useEs6|use ES6 templates| |false| ## IMPORT MAPPING @@ -28,58 +28,58 @@ sidebar_label: javascript-closure-angular ## LANGUAGE PRIMITIVES -
                                                                                                                                                                    • number
                                                                                                                                                                    • -
                                                                                                                                                                    • Blob
                                                                                                                                                                    • +
                                                                                                                                                                      • Blob
                                                                                                                                                                      • +
                                                                                                                                                                      • Date
                                                                                                                                                                      • +
                                                                                                                                                                      • Object
                                                                                                                                                                      • boolean
                                                                                                                                                                      • +
                                                                                                                                                                      • number
                                                                                                                                                                      • string
                                                                                                                                                                      • -
                                                                                                                                                                      • Object
                                                                                                                                                                      • -
                                                                                                                                                                      • Date
                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                      • implements
                                                                                                                                                                      • -
                                                                                                                                                                      • synchronized
                                                                                                                                                                      • -
                                                                                                                                                                      • private
                                                                                                                                                                      • -
                                                                                                                                                                      • import
                                                                                                                                                                      • +
                                                                                                                                                                        • abstract
                                                                                                                                                                        • +
                                                                                                                                                                        • assert
                                                                                                                                                                        • +
                                                                                                                                                                        • break
                                                                                                                                                                        • +
                                                                                                                                                                        • byte
                                                                                                                                                                        • +
                                                                                                                                                                        • case
                                                                                                                                                                        • +
                                                                                                                                                                        • catch
                                                                                                                                                                        • +
                                                                                                                                                                        • char
                                                                                                                                                                        • +
                                                                                                                                                                        • class
                                                                                                                                                                        • const
                                                                                                                                                                        • -
                                                                                                                                                                        • for
                                                                                                                                                                        • -
                                                                                                                                                                        • do
                                                                                                                                                                        • -
                                                                                                                                                                        • interface
                                                                                                                                                                        • -
                                                                                                                                                                        • while
                                                                                                                                                                        • -
                                                                                                                                                                        • switch
                                                                                                                                                                        • -
                                                                                                                                                                        • default
                                                                                                                                                                        • -
                                                                                                                                                                        • goto
                                                                                                                                                                        • -
                                                                                                                                                                        • protected
                                                                                                                                                                        • -
                                                                                                                                                                        • public
                                                                                                                                                                        • continue
                                                                                                                                                                        • -
                                                                                                                                                                        • assert
                                                                                                                                                                        • +
                                                                                                                                                                        • default
                                                                                                                                                                        • +
                                                                                                                                                                        • do
                                                                                                                                                                        • +
                                                                                                                                                                        • double
                                                                                                                                                                        • else
                                                                                                                                                                        • -
                                                                                                                                                                        • catch
                                                                                                                                                                        • +
                                                                                                                                                                        • enum
                                                                                                                                                                        • +
                                                                                                                                                                        • extends
                                                                                                                                                                        • +
                                                                                                                                                                        • final
                                                                                                                                                                        • +
                                                                                                                                                                        • finally
                                                                                                                                                                        • +
                                                                                                                                                                        • for
                                                                                                                                                                        • +
                                                                                                                                                                        • goto
                                                                                                                                                                        • if
                                                                                                                                                                        • -
                                                                                                                                                                        • class
                                                                                                                                                                        • -
                                                                                                                                                                        • case
                                                                                                                                                                        • +
                                                                                                                                                                        • implements
                                                                                                                                                                        • +
                                                                                                                                                                        • import
                                                                                                                                                                        • +
                                                                                                                                                                        • instanceof
                                                                                                                                                                        • +
                                                                                                                                                                        • int
                                                                                                                                                                        • +
                                                                                                                                                                        • interface
                                                                                                                                                                        • new
                                                                                                                                                                        • package
                                                                                                                                                                        • +
                                                                                                                                                                        • private
                                                                                                                                                                        • +
                                                                                                                                                                        • protected
                                                                                                                                                                        • +
                                                                                                                                                                        • public
                                                                                                                                                                        • +
                                                                                                                                                                        • return
                                                                                                                                                                        • +
                                                                                                                                                                        • short
                                                                                                                                                                        • static
                                                                                                                                                                        • -
                                                                                                                                                                        • void
                                                                                                                                                                        • -
                                                                                                                                                                        • break
                                                                                                                                                                        • -
                                                                                                                                                                        • double
                                                                                                                                                                        • -
                                                                                                                                                                        • byte
                                                                                                                                                                        • -
                                                                                                                                                                        • finally
                                                                                                                                                                        • -
                                                                                                                                                                        • this
                                                                                                                                                                        • -
                                                                                                                                                                        • abstract
                                                                                                                                                                        • -
                                                                                                                                                                        • throws
                                                                                                                                                                        • -
                                                                                                                                                                        • enum
                                                                                                                                                                        • -
                                                                                                                                                                        • int
                                                                                                                                                                        • -
                                                                                                                                                                        • instanceof
                                                                                                                                                                        • super
                                                                                                                                                                        • -
                                                                                                                                                                        • extends
                                                                                                                                                                        • +
                                                                                                                                                                        • switch
                                                                                                                                                                        • +
                                                                                                                                                                        • synchronized
                                                                                                                                                                        • +
                                                                                                                                                                        • this
                                                                                                                                                                        • throw
                                                                                                                                                                        • +
                                                                                                                                                                        • throws
                                                                                                                                                                        • transient
                                                                                                                                                                        • -
                                                                                                                                                                        • char
                                                                                                                                                                        • -
                                                                                                                                                                        • final
                                                                                                                                                                        • -
                                                                                                                                                                        • short
                                                                                                                                                                        • try
                                                                                                                                                                        • -
                                                                                                                                                                        • return
                                                                                                                                                                        • +
                                                                                                                                                                        • void
                                                                                                                                                                        • +
                                                                                                                                                                        • while
                                                                                                                                                                        diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 653f03e94851..0946f5191209 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -5,17 +5,17 @@ sidebar_label: javascript-flowtyped | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| -|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|supportsES6|Generate code that conforms to ES6.| |false| ## IMPORT MAPPING @@ -35,101 +35,101 @@ sidebar_label: javascript-flowtyped ## LANGUAGE PRIMITIVES
                                                                                                                                                                        • Array
                                                                                                                                                                        • -
                                                                                                                                                                        • number
                                                                                                                                                                        • Blob
                                                                                                                                                                        • +
                                                                                                                                                                        • Date
                                                                                                                                                                        • +
                                                                                                                                                                        • File
                                                                                                                                                                        • +
                                                                                                                                                                        • Object
                                                                                                                                                                        • boolean
                                                                                                                                                                        • +
                                                                                                                                                                        • number
                                                                                                                                                                        • string
                                                                                                                                                                        • -
                                                                                                                                                                        • Object
                                                                                                                                                                        • -
                                                                                                                                                                        • File
                                                                                                                                                                        • -
                                                                                                                                                                        • Date
                                                                                                                                                                        ## RESERVED WORDS -
                                                                                                                                                                        • date
                                                                                                                                                                        • -
                                                                                                                                                                        • synchronized
                                                                                                                                                                        • -
                                                                                                                                                                        • requestoptions
                                                                                                                                                                        • +
                                                                                                                                                                          • abstract
                                                                                                                                                                          • +
                                                                                                                                                                          • arguments
                                                                                                                                                                          • +
                                                                                                                                                                          • array
                                                                                                                                                                          • +
                                                                                                                                                                          • boolean
                                                                                                                                                                          • +
                                                                                                                                                                          • break
                                                                                                                                                                          • +
                                                                                                                                                                          • byte
                                                                                                                                                                          • +
                                                                                                                                                                          • case
                                                                                                                                                                          • +
                                                                                                                                                                          • catch
                                                                                                                                                                          • +
                                                                                                                                                                          • char
                                                                                                                                                                          • +
                                                                                                                                                                          • class
                                                                                                                                                                          • +
                                                                                                                                                                          • const
                                                                                                                                                                          • +
                                                                                                                                                                          • continue
                                                                                                                                                                          • +
                                                                                                                                                                          • date
                                                                                                                                                                          • debugger
                                                                                                                                                                          • -
                                                                                                                                                                          • isfinite
                                                                                                                                                                          • +
                                                                                                                                                                          • default
                                                                                                                                                                          • +
                                                                                                                                                                          • delete
                                                                                                                                                                          • do
                                                                                                                                                                          • -
                                                                                                                                                                          • float
                                                                                                                                                                          • -
                                                                                                                                                                          • while
                                                                                                                                                                          • -
                                                                                                                                                                          • hasownproperty
                                                                                                                                                                          • -
                                                                                                                                                                          • number
                                                                                                                                                                          • -
                                                                                                                                                                          • protected
                                                                                                                                                                          • -
                                                                                                                                                                          • continue
                                                                                                                                                                          • -
                                                                                                                                                                          • else
                                                                                                                                                                          • -
                                                                                                                                                                          • function
                                                                                                                                                                          • -
                                                                                                                                                                          • let
                                                                                                                                                                          • -
                                                                                                                                                                          • nan
                                                                                                                                                                          • -
                                                                                                                                                                          • catch
                                                                                                                                                                          • -
                                                                                                                                                                          • export
                                                                                                                                                                          • -
                                                                                                                                                                          • if
                                                                                                                                                                          • -
                                                                                                                                                                          • case
                                                                                                                                                                          • -
                                                                                                                                                                          • new
                                                                                                                                                                          • -
                                                                                                                                                                          • package
                                                                                                                                                                          • -
                                                                                                                                                                          • static
                                                                                                                                                                          • -
                                                                                                                                                                          • void
                                                                                                                                                                          • -
                                                                                                                                                                          • in
                                                                                                                                                                          • -
                                                                                                                                                                          • byte
                                                                                                                                                                          • double
                                                                                                                                                                          • -
                                                                                                                                                                          • var
                                                                                                                                                                          • -
                                                                                                                                                                          • finally
                                                                                                                                                                          • -
                                                                                                                                                                          • this
                                                                                                                                                                          • -
                                                                                                                                                                          • isprototypeof
                                                                                                                                                                          • -
                                                                                                                                                                          • throws
                                                                                                                                                                          • -
                                                                                                                                                                          • formparams
                                                                                                                                                                          • +
                                                                                                                                                                          • else
                                                                                                                                                                          • enum
                                                                                                                                                                          • -
                                                                                                                                                                          • headerparams
                                                                                                                                                                          • -
                                                                                                                                                                          • varlocaldeferred
                                                                                                                                                                          • -
                                                                                                                                                                          • useformdata
                                                                                                                                                                          • eval
                                                                                                                                                                          • +
                                                                                                                                                                          • export
                                                                                                                                                                          • extends
                                                                                                                                                                          • -
                                                                                                                                                                          • null
                                                                                                                                                                          • -
                                                                                                                                                                          • transient
                                                                                                                                                                          • +
                                                                                                                                                                          • false
                                                                                                                                                                          • final
                                                                                                                                                                          • -
                                                                                                                                                                          • true
                                                                                                                                                                          • -
                                                                                                                                                                          • try
                                                                                                                                                                          • -
                                                                                                                                                                          • math
                                                                                                                                                                          • -
                                                                                                                                                                          • varlocalpath
                                                                                                                                                                          • -
                                                                                                                                                                          • object
                                                                                                                                                                          • +
                                                                                                                                                                          • finally
                                                                                                                                                                          • +
                                                                                                                                                                          • float
                                                                                                                                                                          • +
                                                                                                                                                                          • for
                                                                                                                                                                          • +
                                                                                                                                                                          • formparams
                                                                                                                                                                          • +
                                                                                                                                                                          • function
                                                                                                                                                                          • +
                                                                                                                                                                          • goto
                                                                                                                                                                          • +
                                                                                                                                                                          • hasownproperty
                                                                                                                                                                          • +
                                                                                                                                                                          • headerparams
                                                                                                                                                                          • +
                                                                                                                                                                          • if
                                                                                                                                                                          • implements
                                                                                                                                                                          • -
                                                                                                                                                                          • private
                                                                                                                                                                          • -
                                                                                                                                                                          • const
                                                                                                                                                                          • import
                                                                                                                                                                          • -
                                                                                                                                                                          • string
                                                                                                                                                                          • -
                                                                                                                                                                          • queryparameters
                                                                                                                                                                          • -
                                                                                                                                                                          • valueof
                                                                                                                                                                          • -
                                                                                                                                                                          • for
                                                                                                                                                                          • +
                                                                                                                                                                          • in
                                                                                                                                                                          • +
                                                                                                                                                                          • infinity
                                                                                                                                                                          • +
                                                                                                                                                                          • instanceof
                                                                                                                                                                          • +
                                                                                                                                                                          • int
                                                                                                                                                                          • interface
                                                                                                                                                                          • +
                                                                                                                                                                          • isfinite
                                                                                                                                                                          • isnan
                                                                                                                                                                          • -
                                                                                                                                                                          • delete
                                                                                                                                                                          • +
                                                                                                                                                                          • isprototypeof
                                                                                                                                                                          • +
                                                                                                                                                                          • let
                                                                                                                                                                          • long
                                                                                                                                                                          • -
                                                                                                                                                                          • switch
                                                                                                                                                                          • -
                                                                                                                                                                          • undefined
                                                                                                                                                                          • -
                                                                                                                                                                          • default
                                                                                                                                                                          • -
                                                                                                                                                                          • goto
                                                                                                                                                                          • -
                                                                                                                                                                          • public
                                                                                                                                                                          • +
                                                                                                                                                                          • math
                                                                                                                                                                          • +
                                                                                                                                                                          • nan
                                                                                                                                                                          • native
                                                                                                                                                                          • -
                                                                                                                                                                          • array
                                                                                                                                                                          • -
                                                                                                                                                                          • yield
                                                                                                                                                                          • -
                                                                                                                                                                          • class
                                                                                                                                                                          • -
                                                                                                                                                                          • typeof
                                                                                                                                                                          • -
                                                                                                                                                                          • break
                                                                                                                                                                          • -
                                                                                                                                                                          • false
                                                                                                                                                                          • -
                                                                                                                                                                          • volatile
                                                                                                                                                                          • -
                                                                                                                                                                          • abstract
                                                                                                                                                                          • +
                                                                                                                                                                          • new
                                                                                                                                                                          • +
                                                                                                                                                                          • null
                                                                                                                                                                          • +
                                                                                                                                                                          • number
                                                                                                                                                                          • +
                                                                                                                                                                          • object
                                                                                                                                                                          • +
                                                                                                                                                                          • package
                                                                                                                                                                          • +
                                                                                                                                                                          • private
                                                                                                                                                                          • +
                                                                                                                                                                          • protected
                                                                                                                                                                          • prototype
                                                                                                                                                                          • -
                                                                                                                                                                          • int
                                                                                                                                                                          • -
                                                                                                                                                                          • instanceof
                                                                                                                                                                          • +
                                                                                                                                                                          • public
                                                                                                                                                                          • +
                                                                                                                                                                          • queryparameters
                                                                                                                                                                          • +
                                                                                                                                                                          • requestoptions
                                                                                                                                                                          • +
                                                                                                                                                                          • return
                                                                                                                                                                          • +
                                                                                                                                                                          • short
                                                                                                                                                                          • +
                                                                                                                                                                          • static
                                                                                                                                                                          • +
                                                                                                                                                                          • string
                                                                                                                                                                          • super
                                                                                                                                                                          • -
                                                                                                                                                                          • with
                                                                                                                                                                          • -
                                                                                                                                                                          • boolean
                                                                                                                                                                          • +
                                                                                                                                                                          • switch
                                                                                                                                                                          • +
                                                                                                                                                                          • synchronized
                                                                                                                                                                          • +
                                                                                                                                                                          • this
                                                                                                                                                                          • throw
                                                                                                                                                                          • -
                                                                                                                                                                          • char
                                                                                                                                                                          • -
                                                                                                                                                                          • short
                                                                                                                                                                          • -
                                                                                                                                                                          • arguments
                                                                                                                                                                          • -
                                                                                                                                                                          • infinity
                                                                                                                                                                          • +
                                                                                                                                                                          • throws
                                                                                                                                                                          • tostring
                                                                                                                                                                          • -
                                                                                                                                                                          • return
                                                                                                                                                                          • +
                                                                                                                                                                          • transient
                                                                                                                                                                          • +
                                                                                                                                                                          • true
                                                                                                                                                                          • +
                                                                                                                                                                          • try
                                                                                                                                                                          • +
                                                                                                                                                                          • typeof
                                                                                                                                                                          • +
                                                                                                                                                                          • undefined
                                                                                                                                                                          • +
                                                                                                                                                                          • useformdata
                                                                                                                                                                          • +
                                                                                                                                                                          • valueof
                                                                                                                                                                          • +
                                                                                                                                                                          • var
                                                                                                                                                                          • +
                                                                                                                                                                          • varlocaldeferred
                                                                                                                                                                          • +
                                                                                                                                                                          • varlocalpath
                                                                                                                                                                          • +
                                                                                                                                                                          • void
                                                                                                                                                                          • +
                                                                                                                                                                          • volatile
                                                                                                                                                                          • +
                                                                                                                                                                          • while
                                                                                                                                                                          • +
                                                                                                                                                                          • with
                                                                                                                                                                          • +
                                                                                                                                                                          • yield
                                                                                                                                                                          diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index d591782d5d81..7064b4a28705 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -5,28 +5,28 @@ sidebar_label: javascript | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|sourceFolder|source folder for generated code| |src| -|invokerPackage|root package for generated code| |null| |apiPackage|package for generated api classes| |null| +|emitJSDoc|generate JSDoc comments| |true| +|emitModelMethods|generate getters and setters for model properties| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|invokerPackage|root package for generated code| |null| +|licenseName|name of the license the project uses (Default: using info.license.name)| |null| |modelPackage|package for generated models| |null| -|projectName|name of the project (Default: generated from info.title or "openapi-js-client")| |null| +|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |moduleName|module name for AMD, Node or globals (Default: generated from <projectName>)| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null| +|projectName|name of the project (Default: generated from info.title or "openapi-js-client")| |null| |projectVersion|version of the project (Default: using info.version or "1.0.0")| |null| -|licenseName|name of the license the project uses (Default: using info.license.name)| |null| -|usePromises|use Promises as return values from the client API, instead of superagent callbacks| |false| -|emitModelMethods|generate getters and setters for model properties| |false| -|emitJSDoc|generate JSDoc comments| |true| -|useInheritance|use JavaScript prototype chains & delegation for inheritance| |true| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|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| |src| |useES6|use JavaScript ES6 (ECMAScript 6) (beta). Default is ES6.| |true| -|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| +|useInheritance|use JavaScript prototype chains & delegation for inheritance| |true| +|usePromises|use Promises as return values from the client API, instead of superagent callbacks| |false| ## IMPORT MAPPING @@ -47,93 +47,93 @@ sidebar_label: javascript
                                                                                                                                                                          • Array
                                                                                                                                                                          • Blob
                                                                                                                                                                          • +
                                                                                                                                                                          • Boolean
                                                                                                                                                                          • +
                                                                                                                                                                          • Date
                                                                                                                                                                          • +
                                                                                                                                                                          • File
                                                                                                                                                                          • Number
                                                                                                                                                                          • Object
                                                                                                                                                                          • String
                                                                                                                                                                          • -
                                                                                                                                                                          • Boolean
                                                                                                                                                                          • -
                                                                                                                                                                          • File
                                                                                                                                                                          • -
                                                                                                                                                                          • Date
                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                          • date
                                                                                                                                                                          • -
                                                                                                                                                                          • synchronized
                                                                                                                                                                          • +
                                                                                                                                                                            • abstract
                                                                                                                                                                            • +
                                                                                                                                                                            • arguments
                                                                                                                                                                            • +
                                                                                                                                                                            • array
                                                                                                                                                                            • +
                                                                                                                                                                            • boolean
                                                                                                                                                                            • +
                                                                                                                                                                            • break
                                                                                                                                                                            • +
                                                                                                                                                                            • byte
                                                                                                                                                                            • +
                                                                                                                                                                            • case
                                                                                                                                                                            • +
                                                                                                                                                                            • catch
                                                                                                                                                                            • +
                                                                                                                                                                            • char
                                                                                                                                                                            • +
                                                                                                                                                                            • class
                                                                                                                                                                            • +
                                                                                                                                                                            • const
                                                                                                                                                                            • +
                                                                                                                                                                            • continue
                                                                                                                                                                            • +
                                                                                                                                                                            • date
                                                                                                                                                                            • debugger
                                                                                                                                                                            • -
                                                                                                                                                                            • isfinite
                                                                                                                                                                            • +
                                                                                                                                                                            • default
                                                                                                                                                                            • +
                                                                                                                                                                            • delete
                                                                                                                                                                            • do
                                                                                                                                                                            • -
                                                                                                                                                                            • float
                                                                                                                                                                            • -
                                                                                                                                                                            • while
                                                                                                                                                                            • -
                                                                                                                                                                            • hasownproperty
                                                                                                                                                                            • -
                                                                                                                                                                            • number
                                                                                                                                                                            • -
                                                                                                                                                                            • protected
                                                                                                                                                                            • -
                                                                                                                                                                            • continue
                                                                                                                                                                            • -
                                                                                                                                                                            • else
                                                                                                                                                                            • -
                                                                                                                                                                            • function
                                                                                                                                                                            • -
                                                                                                                                                                            • let
                                                                                                                                                                            • -
                                                                                                                                                                            • nan
                                                                                                                                                                            • -
                                                                                                                                                                            • catch
                                                                                                                                                                            • -
                                                                                                                                                                            • export
                                                                                                                                                                            • -
                                                                                                                                                                            • if
                                                                                                                                                                            • -
                                                                                                                                                                            • case
                                                                                                                                                                            • -
                                                                                                                                                                            • new
                                                                                                                                                                            • -
                                                                                                                                                                            • package
                                                                                                                                                                            • -
                                                                                                                                                                            • static
                                                                                                                                                                            • -
                                                                                                                                                                            • void
                                                                                                                                                                            • -
                                                                                                                                                                            • in
                                                                                                                                                                            • -
                                                                                                                                                                            • byte
                                                                                                                                                                            • double
                                                                                                                                                                            • -
                                                                                                                                                                            • var
                                                                                                                                                                            • -
                                                                                                                                                                            • finally
                                                                                                                                                                            • -
                                                                                                                                                                            • this
                                                                                                                                                                            • -
                                                                                                                                                                            • isprototypeof
                                                                                                                                                                            • -
                                                                                                                                                                            • throws
                                                                                                                                                                            • +
                                                                                                                                                                            • else
                                                                                                                                                                            • enum
                                                                                                                                                                            • eval
                                                                                                                                                                            • +
                                                                                                                                                                            • export
                                                                                                                                                                            • extends
                                                                                                                                                                            • -
                                                                                                                                                                            • null
                                                                                                                                                                            • -
                                                                                                                                                                            • transient
                                                                                                                                                                            • +
                                                                                                                                                                            • false
                                                                                                                                                                            • final
                                                                                                                                                                            • -
                                                                                                                                                                            • true
                                                                                                                                                                            • -
                                                                                                                                                                            • try
                                                                                                                                                                            • -
                                                                                                                                                                            • math
                                                                                                                                                                            • -
                                                                                                                                                                            • object
                                                                                                                                                                            • +
                                                                                                                                                                            • finally
                                                                                                                                                                            • +
                                                                                                                                                                            • float
                                                                                                                                                                            • +
                                                                                                                                                                            • for
                                                                                                                                                                            • +
                                                                                                                                                                            • function
                                                                                                                                                                            • +
                                                                                                                                                                            • goto
                                                                                                                                                                            • +
                                                                                                                                                                            • hasownproperty
                                                                                                                                                                            • +
                                                                                                                                                                            • if
                                                                                                                                                                            • implements
                                                                                                                                                                            • -
                                                                                                                                                                            • private
                                                                                                                                                                            • -
                                                                                                                                                                            • const
                                                                                                                                                                            • import
                                                                                                                                                                            • -
                                                                                                                                                                            • string
                                                                                                                                                                            • -
                                                                                                                                                                            • valueof
                                                                                                                                                                            • -
                                                                                                                                                                            • for
                                                                                                                                                                            • +
                                                                                                                                                                            • in
                                                                                                                                                                            • +
                                                                                                                                                                            • infinity
                                                                                                                                                                            • +
                                                                                                                                                                            • instanceof
                                                                                                                                                                            • +
                                                                                                                                                                            • int
                                                                                                                                                                            • interface
                                                                                                                                                                            • +
                                                                                                                                                                            • isfinite
                                                                                                                                                                            • isnan
                                                                                                                                                                            • -
                                                                                                                                                                            • delete
                                                                                                                                                                            • +
                                                                                                                                                                            • isprototypeof
                                                                                                                                                                            • +
                                                                                                                                                                            • let
                                                                                                                                                                            • long
                                                                                                                                                                            • -
                                                                                                                                                                            • switch
                                                                                                                                                                            • -
                                                                                                                                                                            • undefined
                                                                                                                                                                            • -
                                                                                                                                                                            • default
                                                                                                                                                                            • -
                                                                                                                                                                            • goto
                                                                                                                                                                            • -
                                                                                                                                                                            • public
                                                                                                                                                                            • +
                                                                                                                                                                            • math
                                                                                                                                                                            • +
                                                                                                                                                                            • nan
                                                                                                                                                                            • native
                                                                                                                                                                            • -
                                                                                                                                                                            • array
                                                                                                                                                                            • -
                                                                                                                                                                            • yield
                                                                                                                                                                            • -
                                                                                                                                                                            • class
                                                                                                                                                                            • -
                                                                                                                                                                            • typeof
                                                                                                                                                                            • -
                                                                                                                                                                            • break
                                                                                                                                                                            • -
                                                                                                                                                                            • false
                                                                                                                                                                            • -
                                                                                                                                                                            • volatile
                                                                                                                                                                            • -
                                                                                                                                                                            • abstract
                                                                                                                                                                            • +
                                                                                                                                                                            • new
                                                                                                                                                                            • +
                                                                                                                                                                            • null
                                                                                                                                                                            • +
                                                                                                                                                                            • number
                                                                                                                                                                            • +
                                                                                                                                                                            • object
                                                                                                                                                                            • +
                                                                                                                                                                            • package
                                                                                                                                                                            • +
                                                                                                                                                                            • private
                                                                                                                                                                            • +
                                                                                                                                                                            • protected
                                                                                                                                                                            • prototype
                                                                                                                                                                            • -
                                                                                                                                                                            • int
                                                                                                                                                                            • -
                                                                                                                                                                            • instanceof
                                                                                                                                                                            • +
                                                                                                                                                                            • public
                                                                                                                                                                            • +
                                                                                                                                                                            • return
                                                                                                                                                                            • +
                                                                                                                                                                            • short
                                                                                                                                                                            • +
                                                                                                                                                                            • static
                                                                                                                                                                            • +
                                                                                                                                                                            • string
                                                                                                                                                                            • super
                                                                                                                                                                            • -
                                                                                                                                                                            • with
                                                                                                                                                                            • -
                                                                                                                                                                            • boolean
                                                                                                                                                                            • +
                                                                                                                                                                            • switch
                                                                                                                                                                            • +
                                                                                                                                                                            • synchronized
                                                                                                                                                                            • +
                                                                                                                                                                            • this
                                                                                                                                                                            • throw
                                                                                                                                                                            • -
                                                                                                                                                                            • char
                                                                                                                                                                            • -
                                                                                                                                                                            • short
                                                                                                                                                                            • -
                                                                                                                                                                            • arguments
                                                                                                                                                                            • -
                                                                                                                                                                            • infinity
                                                                                                                                                                            • +
                                                                                                                                                                            • throws
                                                                                                                                                                            • tostring
                                                                                                                                                                            • -
                                                                                                                                                                            • return
                                                                                                                                                                            • +
                                                                                                                                                                            • transient
                                                                                                                                                                            • +
                                                                                                                                                                            • true
                                                                                                                                                                            • +
                                                                                                                                                                            • try
                                                                                                                                                                            • +
                                                                                                                                                                            • typeof
                                                                                                                                                                            • +
                                                                                                                                                                            • undefined
                                                                                                                                                                            • +
                                                                                                                                                                            • valueof
                                                                                                                                                                            • +
                                                                                                                                                                            • var
                                                                                                                                                                            • +
                                                                                                                                                                            • void
                                                                                                                                                                            • +
                                                                                                                                                                            • volatile
                                                                                                                                                                            • +
                                                                                                                                                                            • while
                                                                                                                                                                            • +
                                                                                                                                                                            • with
                                                                                                                                                                            • +
                                                                                                                                                                            • yield
                                                                                                                                                                            diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index d9cad8eca22e..0842a00ccef5 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -5,75 +5,74 @@ sidebar_label: jaxrs-cxf-cdi | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-cxf-cdi-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                            **joda**
                                                                                                                                                                            Joda (for legacy app only)
                                                                                                                                                                            **legacy**
                                                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                            **java8-localdatetime**
                                                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                            **java8**
                                                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                            **threetenbp**
                                                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                            |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/gen/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generatePom|Whether to generate pom.xml if the file does not already exist.| |true| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                            **joda**
                                                                                                                                                                            Joda (for legacy app only)
                                                                                                                                                                            **legacy**
                                                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                            **java8-localdatetime**
                                                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                            **java8**
                                                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                            **threetenbp**
                                                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                            |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                            **true**
                                                                                                                                                                            Use Java 8 classes such as Base64
                                                                                                                                                                            **false**
                                                                                                                                                                            Various third party libraries as needed
                                                                                                                                                                            |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|library|library template (sub-template)|
                                                                                                                                                                            **<default>**
                                                                                                                                                                            JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
                                                                                                                                                                            **quarkus**
                                                                                                                                                                            Server using Quarkus
                                                                                                                                                                            **thorntail**
                                                                                                                                                                            Server using Thorntail
                                                                                                                                                                            **openliberty**
                                                                                                                                                                            Server using Open Liberty
                                                                                                                                                                            **helidon**
                                                                                                                                                                            Server using Helidon
                                                                                                                                                                            |<default>| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| +|openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                            **true**
                                                                                                                                                                            Use a SnapShot Version
                                                                                                                                                                            **false**
                                                                                                                                                                            Use a Release Version
                                                                                                                                                                            |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/gen/java| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|library|library template (sub-template)|
                                                                                                                                                                            **<default>**
                                                                                                                                                                            JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
                                                                                                                                                                            **quarkus**
                                                                                                                                                                            Server using Quarkus
                                                                                                                                                                            **thorntail**
                                                                                                                                                                            Server using Thorntail
                                                                                                                                                                            **openliberty**
                                                                                                                                                                            Server using Open Liberty
                                                                                                                                                                            **helidon**
                                                                                                                                                                            Server using Helidon
                                                                                                                                                                            |<default>| -|generatePom|Whether to generate pom.xml if the file does not already exist.| |true| -|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| -|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false| |useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| -|openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| -|useBeanValidation|Use BeanValidation API annotations| |true| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.LocalDate| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -86,87 +85,87 @@ sidebar_label: jaxrs-cxf-cdi ## LANGUAGE PRIMITIVES -
                                                                                                                                                                            • Integer
                                                                                                                                                                            • -
                                                                                                                                                                            • byte[]
                                                                                                                                                                            • +
                                                                                                                                                                              • Boolean
                                                                                                                                                                              • +
                                                                                                                                                                              • Double
                                                                                                                                                                              • Float
                                                                                                                                                                              • -
                                                                                                                                                                              • boolean
                                                                                                                                                                              • +
                                                                                                                                                                              • Integer
                                                                                                                                                                              • Long
                                                                                                                                                                              • Object
                                                                                                                                                                              • String
                                                                                                                                                                              • -
                                                                                                                                                                              • Boolean
                                                                                                                                                                              • -
                                                                                                                                                                              • Double
                                                                                                                                                                              • +
                                                                                                                                                                              • boolean
                                                                                                                                                                              • +
                                                                                                                                                                              • byte[]
                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                              • localvaraccepts
                                                                                                                                                                              • -
                                                                                                                                                                              • synchronized
                                                                                                                                                                              • -
                                                                                                                                                                              • do
                                                                                                                                                                              • -
                                                                                                                                                                              • float
                                                                                                                                                                              • -
                                                                                                                                                                              • while
                                                                                                                                                                              • -
                                                                                                                                                                              • localvarpath
                                                                                                                                                                              • -
                                                                                                                                                                              • protected
                                                                                                                                                                              • -
                                                                                                                                                                              • continue
                                                                                                                                                                              • -
                                                                                                                                                                              • else
                                                                                                                                                                              • +
                                                                                                                                                                                • abstract
                                                                                                                                                                                • apiclient
                                                                                                                                                                                • -
                                                                                                                                                                                • localvarqueryparams
                                                                                                                                                                                • -
                                                                                                                                                                                • catch
                                                                                                                                                                                • -
                                                                                                                                                                                • if
                                                                                                                                                                                • +
                                                                                                                                                                                • apiexception
                                                                                                                                                                                • +
                                                                                                                                                                                • apiresponse
                                                                                                                                                                                • +
                                                                                                                                                                                • assert
                                                                                                                                                                                • +
                                                                                                                                                                                • boolean
                                                                                                                                                                                • +
                                                                                                                                                                                • break
                                                                                                                                                                                • +
                                                                                                                                                                                • byte
                                                                                                                                                                                • case
                                                                                                                                                                                • -
                                                                                                                                                                                • new
                                                                                                                                                                                • -
                                                                                                                                                                                • package
                                                                                                                                                                                • -
                                                                                                                                                                                • static
                                                                                                                                                                                • -
                                                                                                                                                                                • void
                                                                                                                                                                                • -
                                                                                                                                                                                • localvaraccept
                                                                                                                                                                                • +
                                                                                                                                                                                • catch
                                                                                                                                                                                • +
                                                                                                                                                                                • char
                                                                                                                                                                                • +
                                                                                                                                                                                • class
                                                                                                                                                                                • +
                                                                                                                                                                                • configuration
                                                                                                                                                                                • +
                                                                                                                                                                                • const
                                                                                                                                                                                • +
                                                                                                                                                                                • continue
                                                                                                                                                                                • +
                                                                                                                                                                                • default
                                                                                                                                                                                • +
                                                                                                                                                                                • do
                                                                                                                                                                                • double
                                                                                                                                                                                • -
                                                                                                                                                                                • byte
                                                                                                                                                                                • -
                                                                                                                                                                                • finally
                                                                                                                                                                                • -
                                                                                                                                                                                • this
                                                                                                                                                                                • -
                                                                                                                                                                                • strictfp
                                                                                                                                                                                • -
                                                                                                                                                                                • throws
                                                                                                                                                                                • +
                                                                                                                                                                                • else
                                                                                                                                                                                • enum
                                                                                                                                                                                • extends
                                                                                                                                                                                • -
                                                                                                                                                                                • null
                                                                                                                                                                                • -
                                                                                                                                                                                • transient
                                                                                                                                                                                • -
                                                                                                                                                                                • apiexception
                                                                                                                                                                                • final
                                                                                                                                                                                • -
                                                                                                                                                                                • try
                                                                                                                                                                                • -
                                                                                                                                                                                • object
                                                                                                                                                                                • -
                                                                                                                                                                                • localvarcontenttypes
                                                                                                                                                                                • +
                                                                                                                                                                                • finally
                                                                                                                                                                                • +
                                                                                                                                                                                • float
                                                                                                                                                                                • +
                                                                                                                                                                                • for
                                                                                                                                                                                • +
                                                                                                                                                                                • goto
                                                                                                                                                                                • +
                                                                                                                                                                                • if
                                                                                                                                                                                • implements
                                                                                                                                                                                • -
                                                                                                                                                                                • private
                                                                                                                                                                                • import
                                                                                                                                                                                • -
                                                                                                                                                                                • const
                                                                                                                                                                                • -
                                                                                                                                                                                • configuration
                                                                                                                                                                                • -
                                                                                                                                                                                • for
                                                                                                                                                                                • -
                                                                                                                                                                                • apiresponse
                                                                                                                                                                                • +
                                                                                                                                                                                • instanceof
                                                                                                                                                                                • +
                                                                                                                                                                                • int
                                                                                                                                                                                • interface
                                                                                                                                                                                • -
                                                                                                                                                                                • long
                                                                                                                                                                                • -
                                                                                                                                                                                • switch
                                                                                                                                                                                • -
                                                                                                                                                                                • default
                                                                                                                                                                                • -
                                                                                                                                                                                • goto
                                                                                                                                                                                • -
                                                                                                                                                                                • public
                                                                                                                                                                                • -
                                                                                                                                                                                • localvarheaderparams
                                                                                                                                                                                • -
                                                                                                                                                                                • native
                                                                                                                                                                                • -
                                                                                                                                                                                • localvarcontenttype
                                                                                                                                                                                • -
                                                                                                                                                                                • assert
                                                                                                                                                                                • -
                                                                                                                                                                                • stringutil
                                                                                                                                                                                • -
                                                                                                                                                                                • class
                                                                                                                                                                                • +
                                                                                                                                                                                • localreturntype
                                                                                                                                                                                • +
                                                                                                                                                                                • localvaraccept
                                                                                                                                                                                • +
                                                                                                                                                                                • localvaraccepts
                                                                                                                                                                                • +
                                                                                                                                                                                • localvarauthnames
                                                                                                                                                                                • localvarcollectionqueryparams
                                                                                                                                                                                • +
                                                                                                                                                                                • localvarcontenttype
                                                                                                                                                                                • +
                                                                                                                                                                                • localvarcontenttypes
                                                                                                                                                                                • localvarcookieparams
                                                                                                                                                                                • -
                                                                                                                                                                                • localreturntype
                                                                                                                                                                                • localvarformparams
                                                                                                                                                                                • -
                                                                                                                                                                                • break
                                                                                                                                                                                • -
                                                                                                                                                                                • volatile
                                                                                                                                                                                • -
                                                                                                                                                                                • localvarauthnames
                                                                                                                                                                                • -
                                                                                                                                                                                • abstract
                                                                                                                                                                                • -
                                                                                                                                                                                • int
                                                                                                                                                                                • -
                                                                                                                                                                                • instanceof
                                                                                                                                                                                • -
                                                                                                                                                                                • super
                                                                                                                                                                                • -
                                                                                                                                                                                • boolean
                                                                                                                                                                                • -
                                                                                                                                                                                • throw
                                                                                                                                                                                • +
                                                                                                                                                                                • localvarheaderparams
                                                                                                                                                                                • +
                                                                                                                                                                                • localvarpath
                                                                                                                                                                                • localvarpostbody
                                                                                                                                                                                • -
                                                                                                                                                                                • char
                                                                                                                                                                                • -
                                                                                                                                                                                • short
                                                                                                                                                                                • +
                                                                                                                                                                                • localvarqueryparams
                                                                                                                                                                                • +
                                                                                                                                                                                • long
                                                                                                                                                                                • +
                                                                                                                                                                                • native
                                                                                                                                                                                • +
                                                                                                                                                                                • new
                                                                                                                                                                                • +
                                                                                                                                                                                • null
                                                                                                                                                                                • +
                                                                                                                                                                                • object
                                                                                                                                                                                • +
                                                                                                                                                                                • package
                                                                                                                                                                                • +
                                                                                                                                                                                • private
                                                                                                                                                                                • +
                                                                                                                                                                                • protected
                                                                                                                                                                                • +
                                                                                                                                                                                • public
                                                                                                                                                                                • return
                                                                                                                                                                                • +
                                                                                                                                                                                • short
                                                                                                                                                                                • +
                                                                                                                                                                                • static
                                                                                                                                                                                • +
                                                                                                                                                                                • strictfp
                                                                                                                                                                                • +
                                                                                                                                                                                • stringutil
                                                                                                                                                                                • +
                                                                                                                                                                                • super
                                                                                                                                                                                • +
                                                                                                                                                                                • switch
                                                                                                                                                                                • +
                                                                                                                                                                                • synchronized
                                                                                                                                                                                • +
                                                                                                                                                                                • this
                                                                                                                                                                                • +
                                                                                                                                                                                • throw
                                                                                                                                                                                • +
                                                                                                                                                                                • throws
                                                                                                                                                                                • +
                                                                                                                                                                                • transient
                                                                                                                                                                                • +
                                                                                                                                                                                • try
                                                                                                                                                                                • +
                                                                                                                                                                                • void
                                                                                                                                                                                • +
                                                                                                                                                                                • volatile
                                                                                                                                                                                • +
                                                                                                                                                                                • while
                                                                                                                                                                                diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 05d97cd950f2..713ef854781c 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -5,68 +5,68 @@ sidebar_label: jaxrs-cxf-client | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-client| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                **joda**
                                                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                                                **legacy**
                                                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                **java8-localdatetime**
                                                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                **java8**
                                                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                **threetenbp**
                                                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/gen/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                **joda**
                                                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                                                **legacy**
                                                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                **java8-localdatetime**
                                                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                **java8**
                                                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                **threetenbp**
                                                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                |legacy| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                **true**
                                                                                                                                                                                Use Java 8 classes such as Base64
                                                                                                                                                                                **false**
                                                                                                                                                                                Various third party libraries as needed
                                                                                                                                                                                |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                **true**
                                                                                                                                                                                Use a SnapShot Version
                                                                                                                                                                                **false**
                                                                                                                                                                                Use a Release Version
                                                                                                                                                                                |null| +|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| |src/gen/java| |useBeanValidation|Use BeanValidation API annotations| |false| +|useGenericResponse|Use generic response| |false| |useGzipFeatureForTests|Use Gzip Feature for tests| |false| |useLoggingFeatureForTests|Use Logging Feature for tests| |false| -|useGenericResponse|Use generic response| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.LocalDate| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -79,87 +79,87 @@ sidebar_label: jaxrs-cxf-client ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                • Integer
                                                                                                                                                                                • -
                                                                                                                                                                                • byte[]
                                                                                                                                                                                • +
                                                                                                                                                                                  • Boolean
                                                                                                                                                                                  • +
                                                                                                                                                                                  • Double
                                                                                                                                                                                  • Float
                                                                                                                                                                                  • -
                                                                                                                                                                                  • boolean
                                                                                                                                                                                  • +
                                                                                                                                                                                  • Integer
                                                                                                                                                                                  • Long
                                                                                                                                                                                  • Object
                                                                                                                                                                                  • String
                                                                                                                                                                                  • -
                                                                                                                                                                                  • Boolean
                                                                                                                                                                                  • -
                                                                                                                                                                                  • Double
                                                                                                                                                                                  • +
                                                                                                                                                                                  • boolean
                                                                                                                                                                                  • +
                                                                                                                                                                                  • byte[]
                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                  • localvaraccepts
                                                                                                                                                                                  • -
                                                                                                                                                                                  • synchronized
                                                                                                                                                                                  • -
                                                                                                                                                                                  • do
                                                                                                                                                                                  • -
                                                                                                                                                                                  • float
                                                                                                                                                                                  • -
                                                                                                                                                                                  • while
                                                                                                                                                                                  • -
                                                                                                                                                                                  • localvarpath
                                                                                                                                                                                  • -
                                                                                                                                                                                  • protected
                                                                                                                                                                                  • -
                                                                                                                                                                                  • continue
                                                                                                                                                                                  • -
                                                                                                                                                                                  • else
                                                                                                                                                                                  • +
                                                                                                                                                                                    • abstract
                                                                                                                                                                                    • apiclient
                                                                                                                                                                                    • -
                                                                                                                                                                                    • localvarqueryparams
                                                                                                                                                                                    • -
                                                                                                                                                                                    • catch
                                                                                                                                                                                    • -
                                                                                                                                                                                    • if
                                                                                                                                                                                    • +
                                                                                                                                                                                    • apiexception
                                                                                                                                                                                    • +
                                                                                                                                                                                    • apiresponse
                                                                                                                                                                                    • +
                                                                                                                                                                                    • assert
                                                                                                                                                                                    • +
                                                                                                                                                                                    • boolean
                                                                                                                                                                                    • +
                                                                                                                                                                                    • break
                                                                                                                                                                                    • +
                                                                                                                                                                                    • byte
                                                                                                                                                                                    • case
                                                                                                                                                                                    • -
                                                                                                                                                                                    • new
                                                                                                                                                                                    • -
                                                                                                                                                                                    • package
                                                                                                                                                                                    • -
                                                                                                                                                                                    • static
                                                                                                                                                                                    • -
                                                                                                                                                                                    • void
                                                                                                                                                                                    • -
                                                                                                                                                                                    • localvaraccept
                                                                                                                                                                                    • +
                                                                                                                                                                                    • catch
                                                                                                                                                                                    • +
                                                                                                                                                                                    • char
                                                                                                                                                                                    • +
                                                                                                                                                                                    • class
                                                                                                                                                                                    • +
                                                                                                                                                                                    • configuration
                                                                                                                                                                                    • +
                                                                                                                                                                                    • const
                                                                                                                                                                                    • +
                                                                                                                                                                                    • continue
                                                                                                                                                                                    • +
                                                                                                                                                                                    • default
                                                                                                                                                                                    • +
                                                                                                                                                                                    • do
                                                                                                                                                                                    • double
                                                                                                                                                                                    • -
                                                                                                                                                                                    • byte
                                                                                                                                                                                    • -
                                                                                                                                                                                    • finally
                                                                                                                                                                                    • -
                                                                                                                                                                                    • this
                                                                                                                                                                                    • -
                                                                                                                                                                                    • strictfp
                                                                                                                                                                                    • -
                                                                                                                                                                                    • throws
                                                                                                                                                                                    • +
                                                                                                                                                                                    • else
                                                                                                                                                                                    • enum
                                                                                                                                                                                    • extends
                                                                                                                                                                                    • -
                                                                                                                                                                                    • null
                                                                                                                                                                                    • -
                                                                                                                                                                                    • transient
                                                                                                                                                                                    • -
                                                                                                                                                                                    • apiexception
                                                                                                                                                                                    • final
                                                                                                                                                                                    • -
                                                                                                                                                                                    • try
                                                                                                                                                                                    • -
                                                                                                                                                                                    • object
                                                                                                                                                                                    • -
                                                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                                                    • +
                                                                                                                                                                                    • finally
                                                                                                                                                                                    • +
                                                                                                                                                                                    • float
                                                                                                                                                                                    • +
                                                                                                                                                                                    • for
                                                                                                                                                                                    • +
                                                                                                                                                                                    • goto
                                                                                                                                                                                    • +
                                                                                                                                                                                    • if
                                                                                                                                                                                    • implements
                                                                                                                                                                                    • -
                                                                                                                                                                                    • private
                                                                                                                                                                                    • import
                                                                                                                                                                                    • -
                                                                                                                                                                                    • const
                                                                                                                                                                                    • -
                                                                                                                                                                                    • configuration
                                                                                                                                                                                    • -
                                                                                                                                                                                    • for
                                                                                                                                                                                    • -
                                                                                                                                                                                    • apiresponse
                                                                                                                                                                                    • +
                                                                                                                                                                                    • instanceof
                                                                                                                                                                                    • +
                                                                                                                                                                                    • int
                                                                                                                                                                                    • interface
                                                                                                                                                                                    • -
                                                                                                                                                                                    • long
                                                                                                                                                                                    • -
                                                                                                                                                                                    • switch
                                                                                                                                                                                    • -
                                                                                                                                                                                    • default
                                                                                                                                                                                    • -
                                                                                                                                                                                    • goto
                                                                                                                                                                                    • -
                                                                                                                                                                                    • public
                                                                                                                                                                                    • -
                                                                                                                                                                                    • localvarheaderparams
                                                                                                                                                                                    • -
                                                                                                                                                                                    • native
                                                                                                                                                                                    • -
                                                                                                                                                                                    • localvarcontenttype
                                                                                                                                                                                    • -
                                                                                                                                                                                    • assert
                                                                                                                                                                                    • -
                                                                                                                                                                                    • stringutil
                                                                                                                                                                                    • -
                                                                                                                                                                                    • class
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localreturntype
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvaraccept
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvaraccepts
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvarauthnames
                                                                                                                                                                                    • localvarcollectionqueryparams
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvarcontenttype
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                                                    • localvarcookieparams
                                                                                                                                                                                    • -
                                                                                                                                                                                    • localreturntype
                                                                                                                                                                                    • localvarformparams
                                                                                                                                                                                    • -
                                                                                                                                                                                    • break
                                                                                                                                                                                    • -
                                                                                                                                                                                    • volatile
                                                                                                                                                                                    • -
                                                                                                                                                                                    • localvarauthnames
                                                                                                                                                                                    • -
                                                                                                                                                                                    • abstract
                                                                                                                                                                                    • -
                                                                                                                                                                                    • int
                                                                                                                                                                                    • -
                                                                                                                                                                                    • instanceof
                                                                                                                                                                                    • -
                                                                                                                                                                                    • super
                                                                                                                                                                                    • -
                                                                                                                                                                                    • boolean
                                                                                                                                                                                    • -
                                                                                                                                                                                    • throw
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvarheaderparams
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvarpath
                                                                                                                                                                                    • localvarpostbody
                                                                                                                                                                                    • -
                                                                                                                                                                                    • char
                                                                                                                                                                                    • -
                                                                                                                                                                                    • short
                                                                                                                                                                                    • +
                                                                                                                                                                                    • localvarqueryparams
                                                                                                                                                                                    • +
                                                                                                                                                                                    • long
                                                                                                                                                                                    • +
                                                                                                                                                                                    • native
                                                                                                                                                                                    • +
                                                                                                                                                                                    • new
                                                                                                                                                                                    • +
                                                                                                                                                                                    • null
                                                                                                                                                                                    • +
                                                                                                                                                                                    • object
                                                                                                                                                                                    • +
                                                                                                                                                                                    • package
                                                                                                                                                                                    • +
                                                                                                                                                                                    • private
                                                                                                                                                                                    • +
                                                                                                                                                                                    • protected
                                                                                                                                                                                    • +
                                                                                                                                                                                    • public
                                                                                                                                                                                    • return
                                                                                                                                                                                    • +
                                                                                                                                                                                    • short
                                                                                                                                                                                    • +
                                                                                                                                                                                    • static
                                                                                                                                                                                    • +
                                                                                                                                                                                    • strictfp
                                                                                                                                                                                    • +
                                                                                                                                                                                    • stringutil
                                                                                                                                                                                    • +
                                                                                                                                                                                    • super
                                                                                                                                                                                    • +
                                                                                                                                                                                    • switch
                                                                                                                                                                                    • +
                                                                                                                                                                                    • synchronized
                                                                                                                                                                                    • +
                                                                                                                                                                                    • this
                                                                                                                                                                                    • +
                                                                                                                                                                                    • throw
                                                                                                                                                                                    • +
                                                                                                                                                                                    • throws
                                                                                                                                                                                    • +
                                                                                                                                                                                    • transient
                                                                                                                                                                                    • +
                                                                                                                                                                                    • try
                                                                                                                                                                                    • +
                                                                                                                                                                                    • void
                                                                                                                                                                                    • +
                                                                                                                                                                                    • volatile
                                                                                                                                                                                    • +
                                                                                                                                                                                    • while
                                                                                                                                                                                    diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index 6811098135f2..14e899514152 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -5,90 +5,90 @@ sidebar_label: jaxrs-cxf-extended | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|addConsumesProducesJson|Add @Consumes/@Produces Json to API interface| |false| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                    **joda**
                                                                                                                                                                                    Joda (for legacy app only)
                                                                                                                                                                                    **legacy**
                                                                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                    **java8-localdatetime**
                                                                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                    **java8**
                                                                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                    **threetenbp**
                                                                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| +|generateNonSpringApplication|Generate non-Spring application| |false| +|generateOperationBody|Generate fully functional operation bodies| |false| +|generateSpringApplication|Generate Spring application| |false| +|generateSpringBootApplication|Generate Spring Boot application| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                    **joda**
                                                                                                                                                                                    Joda (for legacy app only)
                                                                                                                                                                                    **legacy**
                                                                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                    **java8-localdatetime**
                                                                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                    **java8**
                                                                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                    **threetenbp**
                                                                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                    |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                    **true**
                                                                                                                                                                                    Use Java 8 classes such as Base64
                                                                                                                                                                                    **false**
                                                                                                                                                                                    Various third party libraries as needed
                                                                                                                                                                                    |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|loadTestDataFromFile|Load test data from a generated JSON file| |false| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                    **true**
                                                                                                                                                                                    Use a SnapShot Version
                                                                                                                                                                                    **false**
                                                                                                                                                                                    Use a Release Version
                                                                                                                                                                                    |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/main/java| +|supportMultipleSpringServices|Support generation of Spring services from multiple specifications| |false| +|testDataControlFile|JSON file to control test data generation| |null| +|testDataFile|JSON file to contain generated test data| |null| |title|a title describing the application| |OpenAPI Server| +|useAnnotatedBasePath|Use @Path annotations for basePath| |false| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|generateSpringApplication|Generate Spring application| |false| -|useSpringAnnotationConfig|Use Spring Annotation Config| |false| -|useSwaggerFeature|Use Swagger Feature| |false| -|useSwaggerUI|Use Swagger UI| |false| -|useWadlFeature|Use WADL Feature| |false| -|useMultipartFeature|Use Multipart Feature| |false| +|useBeanValidationFeature|Use BeanValidation Feature| |false| +|useGenericResponse|Use generic response| |false| |useGzipFeature|Use Gzip Feature| |false| |useGzipFeatureForTests|Use Gzip Feature for tests| |false| -|useBeanValidationFeature|Use BeanValidation Feature| |false| |useLoggingFeature|Use Logging Feature| |false| |useLoggingFeatureForTests|Use Logging Feature for tests| |false| -|generateSpringBootApplication|Generate Spring Boot application| |false| -|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| -|addConsumesProducesJson|Add @Consumes/@Produces Json to API interface| |false| -|useAnnotatedBasePath|Use @Path annotations for basePath| |false| -|generateNonSpringApplication|Generate non-Spring application| |false| -|useGenericResponse|Use generic response| |false| -|supportMultipleSpringServices|Support generation of Spring services from multiple specifications| |false| -|generateOperationBody|Generate fully functional operation bodies| |false| -|loadTestDataFromFile|Load test data from a generated JSON file| |false| -|testDataFile|JSON file to contain generated test data| |null| -|testDataControlFile|JSON file to control test data generation| |null| +|useMultipartFeature|Use Multipart Feature| |false| +|useSpringAnnotationConfig|Use Spring Annotation Config| |false| +|useSwaggerFeature|Use Swagger Feature| |false| +|useSwaggerUI|Use Swagger UI| |false| +|useWadlFeature|Use WADL Feature| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.LocalDate| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -101,87 +101,87 @@ sidebar_label: jaxrs-cxf-extended ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                    • Integer
                                                                                                                                                                                    • -
                                                                                                                                                                                    • byte[]
                                                                                                                                                                                    • +
                                                                                                                                                                                      • Boolean
                                                                                                                                                                                      • +
                                                                                                                                                                                      • Double
                                                                                                                                                                                      • Float
                                                                                                                                                                                      • -
                                                                                                                                                                                      • boolean
                                                                                                                                                                                      • +
                                                                                                                                                                                      • Integer
                                                                                                                                                                                      • Long
                                                                                                                                                                                      • Object
                                                                                                                                                                                      • String
                                                                                                                                                                                      • -
                                                                                                                                                                                      • Boolean
                                                                                                                                                                                      • -
                                                                                                                                                                                      • Double
                                                                                                                                                                                      • +
                                                                                                                                                                                      • boolean
                                                                                                                                                                                      • +
                                                                                                                                                                                      • byte[]
                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                      • localvaraccepts
                                                                                                                                                                                      • -
                                                                                                                                                                                      • synchronized
                                                                                                                                                                                      • -
                                                                                                                                                                                      • do
                                                                                                                                                                                      • -
                                                                                                                                                                                      • float
                                                                                                                                                                                      • -
                                                                                                                                                                                      • while
                                                                                                                                                                                      • -
                                                                                                                                                                                      • localvarpath
                                                                                                                                                                                      • -
                                                                                                                                                                                      • protected
                                                                                                                                                                                      • -
                                                                                                                                                                                      • continue
                                                                                                                                                                                      • -
                                                                                                                                                                                      • else
                                                                                                                                                                                      • +
                                                                                                                                                                                        • abstract
                                                                                                                                                                                        • apiclient
                                                                                                                                                                                        • -
                                                                                                                                                                                        • localvarqueryparams
                                                                                                                                                                                        • -
                                                                                                                                                                                        • catch
                                                                                                                                                                                        • -
                                                                                                                                                                                        • if
                                                                                                                                                                                        • +
                                                                                                                                                                                        • apiexception
                                                                                                                                                                                        • +
                                                                                                                                                                                        • apiresponse
                                                                                                                                                                                        • +
                                                                                                                                                                                        • assert
                                                                                                                                                                                        • +
                                                                                                                                                                                        • boolean
                                                                                                                                                                                        • +
                                                                                                                                                                                        • break
                                                                                                                                                                                        • +
                                                                                                                                                                                        • byte
                                                                                                                                                                                        • case
                                                                                                                                                                                        • -
                                                                                                                                                                                        • new
                                                                                                                                                                                        • -
                                                                                                                                                                                        • package
                                                                                                                                                                                        • -
                                                                                                                                                                                        • static
                                                                                                                                                                                        • -
                                                                                                                                                                                        • void
                                                                                                                                                                                        • -
                                                                                                                                                                                        • localvaraccept
                                                                                                                                                                                        • +
                                                                                                                                                                                        • catch
                                                                                                                                                                                        • +
                                                                                                                                                                                        • char
                                                                                                                                                                                        • +
                                                                                                                                                                                        • class
                                                                                                                                                                                        • +
                                                                                                                                                                                        • configuration
                                                                                                                                                                                        • +
                                                                                                                                                                                        • const
                                                                                                                                                                                        • +
                                                                                                                                                                                        • continue
                                                                                                                                                                                        • +
                                                                                                                                                                                        • default
                                                                                                                                                                                        • +
                                                                                                                                                                                        • do
                                                                                                                                                                                        • double
                                                                                                                                                                                        • -
                                                                                                                                                                                        • byte
                                                                                                                                                                                        • -
                                                                                                                                                                                        • finally
                                                                                                                                                                                        • -
                                                                                                                                                                                        • this
                                                                                                                                                                                        • -
                                                                                                                                                                                        • strictfp
                                                                                                                                                                                        • -
                                                                                                                                                                                        • throws
                                                                                                                                                                                        • +
                                                                                                                                                                                        • else
                                                                                                                                                                                        • enum
                                                                                                                                                                                        • extends
                                                                                                                                                                                        • -
                                                                                                                                                                                        • null
                                                                                                                                                                                        • -
                                                                                                                                                                                        • transient
                                                                                                                                                                                        • -
                                                                                                                                                                                        • apiexception
                                                                                                                                                                                        • final
                                                                                                                                                                                        • -
                                                                                                                                                                                        • try
                                                                                                                                                                                        • -
                                                                                                                                                                                        • object
                                                                                                                                                                                        • -
                                                                                                                                                                                        • localvarcontenttypes
                                                                                                                                                                                        • +
                                                                                                                                                                                        • finally
                                                                                                                                                                                        • +
                                                                                                                                                                                        • float
                                                                                                                                                                                        • +
                                                                                                                                                                                        • for
                                                                                                                                                                                        • +
                                                                                                                                                                                        • goto
                                                                                                                                                                                        • +
                                                                                                                                                                                        • if
                                                                                                                                                                                        • implements
                                                                                                                                                                                        • -
                                                                                                                                                                                        • private
                                                                                                                                                                                        • import
                                                                                                                                                                                        • -
                                                                                                                                                                                        • const
                                                                                                                                                                                        • -
                                                                                                                                                                                        • configuration
                                                                                                                                                                                        • -
                                                                                                                                                                                        • for
                                                                                                                                                                                        • -
                                                                                                                                                                                        • apiresponse
                                                                                                                                                                                        • +
                                                                                                                                                                                        • instanceof
                                                                                                                                                                                        • +
                                                                                                                                                                                        • int
                                                                                                                                                                                        • interface
                                                                                                                                                                                        • -
                                                                                                                                                                                        • long
                                                                                                                                                                                        • -
                                                                                                                                                                                        • switch
                                                                                                                                                                                        • -
                                                                                                                                                                                        • default
                                                                                                                                                                                        • -
                                                                                                                                                                                        • goto
                                                                                                                                                                                        • -
                                                                                                                                                                                        • public
                                                                                                                                                                                        • -
                                                                                                                                                                                        • localvarheaderparams
                                                                                                                                                                                        • -
                                                                                                                                                                                        • native
                                                                                                                                                                                        • -
                                                                                                                                                                                        • localvarcontenttype
                                                                                                                                                                                        • -
                                                                                                                                                                                        • assert
                                                                                                                                                                                        • -
                                                                                                                                                                                        • stringutil
                                                                                                                                                                                        • -
                                                                                                                                                                                        • class
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localreturntype
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvaraccept
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvaraccepts
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvarauthnames
                                                                                                                                                                                        • localvarcollectionqueryparams
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvarcontenttype
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvarcontenttypes
                                                                                                                                                                                        • localvarcookieparams
                                                                                                                                                                                        • -
                                                                                                                                                                                        • localreturntype
                                                                                                                                                                                        • localvarformparams
                                                                                                                                                                                        • -
                                                                                                                                                                                        • break
                                                                                                                                                                                        • -
                                                                                                                                                                                        • volatile
                                                                                                                                                                                        • -
                                                                                                                                                                                        • localvarauthnames
                                                                                                                                                                                        • -
                                                                                                                                                                                        • abstract
                                                                                                                                                                                        • -
                                                                                                                                                                                        • int
                                                                                                                                                                                        • -
                                                                                                                                                                                        • instanceof
                                                                                                                                                                                        • -
                                                                                                                                                                                        • super
                                                                                                                                                                                        • -
                                                                                                                                                                                        • boolean
                                                                                                                                                                                        • -
                                                                                                                                                                                        • throw
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvarheaderparams
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvarpath
                                                                                                                                                                                        • localvarpostbody
                                                                                                                                                                                        • -
                                                                                                                                                                                        • char
                                                                                                                                                                                        • -
                                                                                                                                                                                        • short
                                                                                                                                                                                        • +
                                                                                                                                                                                        • localvarqueryparams
                                                                                                                                                                                        • +
                                                                                                                                                                                        • long
                                                                                                                                                                                        • +
                                                                                                                                                                                        • native
                                                                                                                                                                                        • +
                                                                                                                                                                                        • new
                                                                                                                                                                                        • +
                                                                                                                                                                                        • null
                                                                                                                                                                                        • +
                                                                                                                                                                                        • object
                                                                                                                                                                                        • +
                                                                                                                                                                                        • package
                                                                                                                                                                                        • +
                                                                                                                                                                                        • private
                                                                                                                                                                                        • +
                                                                                                                                                                                        • protected
                                                                                                                                                                                        • +
                                                                                                                                                                                        • public
                                                                                                                                                                                        • return
                                                                                                                                                                                        • +
                                                                                                                                                                                        • short
                                                                                                                                                                                        • +
                                                                                                                                                                                        • static
                                                                                                                                                                                        • +
                                                                                                                                                                                        • strictfp
                                                                                                                                                                                        • +
                                                                                                                                                                                        • stringutil
                                                                                                                                                                                        • +
                                                                                                                                                                                        • super
                                                                                                                                                                                        • +
                                                                                                                                                                                        • switch
                                                                                                                                                                                        • +
                                                                                                                                                                                        • synchronized
                                                                                                                                                                                        • +
                                                                                                                                                                                        • this
                                                                                                                                                                                        • +
                                                                                                                                                                                        • throw
                                                                                                                                                                                        • +
                                                                                                                                                                                        • throws
                                                                                                                                                                                        • +
                                                                                                                                                                                        • transient
                                                                                                                                                                                        • +
                                                                                                                                                                                        • try
                                                                                                                                                                                        • +
                                                                                                                                                                                        • void
                                                                                                                                                                                        • +
                                                                                                                                                                                        • volatile
                                                                                                                                                                                        • +
                                                                                                                                                                                        • while
                                                                                                                                                                                        diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 515319a26ee3..1fc41f7b179b 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -5,85 +5,85 @@ sidebar_label: jaxrs-cxf | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|addConsumesProducesJson|Add @Consumes/@Produces Json to API interface| |false| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-cxf-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                        **joda**
                                                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                                                        **legacy**
                                                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                        **java8**
                                                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                        |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| +|generateNonSpringApplication|Generate non-Spring application| |false| +|generateSpringApplication|Generate Spring application| |false| +|generateSpringBootApplication|Generate Spring Boot application| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                        **joda**
                                                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                                                        **legacy**
                                                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                        **java8**
                                                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                        |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                        **true**
                                                                                                                                                                                        Use Java 8 classes such as Base64
                                                                                                                                                                                        **false**
                                                                                                                                                                                        Various third party libraries as needed
                                                                                                                                                                                        |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                        **true**
                                                                                                                                                                                        Use a SnapShot Version
                                                                                                                                                                                        **false**
                                                                                                                                                                                        Use a Release Version
                                                                                                                                                                                        |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/main/java| |title|a title describing the application| |OpenAPI Server| +|useAnnotatedBasePath|Use @Path annotations for basePath| |false| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|generateSpringApplication|Generate Spring application| |false| -|useSpringAnnotationConfig|Use Spring Annotation Config| |false| -|useSwaggerFeature|Use Swagger Feature| |false| -|useSwaggerUI|Use Swagger UI| |false| -|useWadlFeature|Use WADL Feature| |false| -|useMultipartFeature|Use Multipart Feature| |false| +|useBeanValidationFeature|Use BeanValidation Feature| |false| +|useGenericResponse|Use generic response| |false| |useGzipFeature|Use Gzip Feature| |false| |useGzipFeatureForTests|Use Gzip Feature for tests| |false| -|useBeanValidationFeature|Use BeanValidation Feature| |false| |useLoggingFeature|Use Logging Feature| |false| |useLoggingFeatureForTests|Use Logging Feature for tests| |false| -|generateSpringBootApplication|Generate Spring Boot application| |false| -|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| -|addConsumesProducesJson|Add @Consumes/@Produces Json to API interface| |false| -|useAnnotatedBasePath|Use @Path annotations for basePath| |false| -|generateNonSpringApplication|Generate non-Spring application| |false| -|useGenericResponse|Use generic response| |false| +|useMultipartFeature|Use Multipart Feature| |false| +|useSpringAnnotationConfig|Use Spring Annotation Config| |false| +|useSwaggerFeature|Use Swagger Feature| |false| +|useSwaggerUI|Use Swagger UI| |false| +|useWadlFeature|Use WADL Feature| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.LocalDate| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -96,87 +96,87 @@ sidebar_label: jaxrs-cxf ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                        • Integer
                                                                                                                                                                                        • -
                                                                                                                                                                                        • byte[]
                                                                                                                                                                                        • +
                                                                                                                                                                                          • Boolean
                                                                                                                                                                                          • +
                                                                                                                                                                                          • Double
                                                                                                                                                                                          • Float
                                                                                                                                                                                          • -
                                                                                                                                                                                          • boolean
                                                                                                                                                                                          • +
                                                                                                                                                                                          • Integer
                                                                                                                                                                                          • Long
                                                                                                                                                                                          • Object
                                                                                                                                                                                          • String
                                                                                                                                                                                          • -
                                                                                                                                                                                          • Boolean
                                                                                                                                                                                          • -
                                                                                                                                                                                          • Double
                                                                                                                                                                                          • +
                                                                                                                                                                                          • boolean
                                                                                                                                                                                          • +
                                                                                                                                                                                          • byte[]
                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                          • localvaraccepts
                                                                                                                                                                                          • -
                                                                                                                                                                                          • synchronized
                                                                                                                                                                                          • -
                                                                                                                                                                                          • do
                                                                                                                                                                                          • -
                                                                                                                                                                                          • float
                                                                                                                                                                                          • -
                                                                                                                                                                                          • while
                                                                                                                                                                                          • -
                                                                                                                                                                                          • localvarpath
                                                                                                                                                                                          • -
                                                                                                                                                                                          • protected
                                                                                                                                                                                          • -
                                                                                                                                                                                          • continue
                                                                                                                                                                                          • -
                                                                                                                                                                                          • else
                                                                                                                                                                                          • +
                                                                                                                                                                                            • abstract
                                                                                                                                                                                            • apiclient
                                                                                                                                                                                            • -
                                                                                                                                                                                            • localvarqueryparams
                                                                                                                                                                                            • -
                                                                                                                                                                                            • catch
                                                                                                                                                                                            • -
                                                                                                                                                                                            • if
                                                                                                                                                                                            • +
                                                                                                                                                                                            • apiexception
                                                                                                                                                                                            • +
                                                                                                                                                                                            • apiresponse
                                                                                                                                                                                            • +
                                                                                                                                                                                            • assert
                                                                                                                                                                                            • +
                                                                                                                                                                                            • boolean
                                                                                                                                                                                            • +
                                                                                                                                                                                            • break
                                                                                                                                                                                            • +
                                                                                                                                                                                            • byte
                                                                                                                                                                                            • case
                                                                                                                                                                                            • -
                                                                                                                                                                                            • new
                                                                                                                                                                                            • -
                                                                                                                                                                                            • package
                                                                                                                                                                                            • -
                                                                                                                                                                                            • static
                                                                                                                                                                                            • -
                                                                                                                                                                                            • void
                                                                                                                                                                                            • -
                                                                                                                                                                                            • localvaraccept
                                                                                                                                                                                            • +
                                                                                                                                                                                            • catch
                                                                                                                                                                                            • +
                                                                                                                                                                                            • char
                                                                                                                                                                                            • +
                                                                                                                                                                                            • class
                                                                                                                                                                                            • +
                                                                                                                                                                                            • configuration
                                                                                                                                                                                            • +
                                                                                                                                                                                            • const
                                                                                                                                                                                            • +
                                                                                                                                                                                            • continue
                                                                                                                                                                                            • +
                                                                                                                                                                                            • default
                                                                                                                                                                                            • +
                                                                                                                                                                                            • do
                                                                                                                                                                                            • double
                                                                                                                                                                                            • -
                                                                                                                                                                                            • byte
                                                                                                                                                                                            • -
                                                                                                                                                                                            • finally
                                                                                                                                                                                            • -
                                                                                                                                                                                            • this
                                                                                                                                                                                            • -
                                                                                                                                                                                            • strictfp
                                                                                                                                                                                            • -
                                                                                                                                                                                            • throws
                                                                                                                                                                                            • +
                                                                                                                                                                                            • else
                                                                                                                                                                                            • enum
                                                                                                                                                                                            • extends
                                                                                                                                                                                            • -
                                                                                                                                                                                            • null
                                                                                                                                                                                            • -
                                                                                                                                                                                            • transient
                                                                                                                                                                                            • -
                                                                                                                                                                                            • apiexception
                                                                                                                                                                                            • final
                                                                                                                                                                                            • -
                                                                                                                                                                                            • try
                                                                                                                                                                                            • -
                                                                                                                                                                                            • object
                                                                                                                                                                                            • -
                                                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                                                            • +
                                                                                                                                                                                            • finally
                                                                                                                                                                                            • +
                                                                                                                                                                                            • float
                                                                                                                                                                                            • +
                                                                                                                                                                                            • for
                                                                                                                                                                                            • +
                                                                                                                                                                                            • goto
                                                                                                                                                                                            • +
                                                                                                                                                                                            • if
                                                                                                                                                                                            • implements
                                                                                                                                                                                            • -
                                                                                                                                                                                            • private
                                                                                                                                                                                            • import
                                                                                                                                                                                            • -
                                                                                                                                                                                            • const
                                                                                                                                                                                            • -
                                                                                                                                                                                            • configuration
                                                                                                                                                                                            • -
                                                                                                                                                                                            • for
                                                                                                                                                                                            • -
                                                                                                                                                                                            • apiresponse
                                                                                                                                                                                            • +
                                                                                                                                                                                            • instanceof
                                                                                                                                                                                            • +
                                                                                                                                                                                            • int
                                                                                                                                                                                            • interface
                                                                                                                                                                                            • -
                                                                                                                                                                                            • long
                                                                                                                                                                                            • -
                                                                                                                                                                                            • switch
                                                                                                                                                                                            • -
                                                                                                                                                                                            • default
                                                                                                                                                                                            • -
                                                                                                                                                                                            • goto
                                                                                                                                                                                            • -
                                                                                                                                                                                            • public
                                                                                                                                                                                            • -
                                                                                                                                                                                            • localvarheaderparams
                                                                                                                                                                                            • -
                                                                                                                                                                                            • native
                                                                                                                                                                                            • -
                                                                                                                                                                                            • localvarcontenttype
                                                                                                                                                                                            • -
                                                                                                                                                                                            • assert
                                                                                                                                                                                            • -
                                                                                                                                                                                            • stringutil
                                                                                                                                                                                            • -
                                                                                                                                                                                            • class
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localreturntype
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvaraccept
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvaraccepts
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvarauthnames
                                                                                                                                                                                            • localvarcollectionqueryparams
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvarcontenttype
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                                                            • localvarcookieparams
                                                                                                                                                                                            • -
                                                                                                                                                                                            • localreturntype
                                                                                                                                                                                            • localvarformparams
                                                                                                                                                                                            • -
                                                                                                                                                                                            • break
                                                                                                                                                                                            • -
                                                                                                                                                                                            • volatile
                                                                                                                                                                                            • -
                                                                                                                                                                                            • localvarauthnames
                                                                                                                                                                                            • -
                                                                                                                                                                                            • abstract
                                                                                                                                                                                            • -
                                                                                                                                                                                            • int
                                                                                                                                                                                            • -
                                                                                                                                                                                            • instanceof
                                                                                                                                                                                            • -
                                                                                                                                                                                            • super
                                                                                                                                                                                            • -
                                                                                                                                                                                            • boolean
                                                                                                                                                                                            • -
                                                                                                                                                                                            • throw
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvarheaderparams
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvarpath
                                                                                                                                                                                            • localvarpostbody
                                                                                                                                                                                            • -
                                                                                                                                                                                            • char
                                                                                                                                                                                            • -
                                                                                                                                                                                            • short
                                                                                                                                                                                            • +
                                                                                                                                                                                            • localvarqueryparams
                                                                                                                                                                                            • +
                                                                                                                                                                                            • long
                                                                                                                                                                                            • +
                                                                                                                                                                                            • native
                                                                                                                                                                                            • +
                                                                                                                                                                                            • new
                                                                                                                                                                                            • +
                                                                                                                                                                                            • null
                                                                                                                                                                                            • +
                                                                                                                                                                                            • object
                                                                                                                                                                                            • +
                                                                                                                                                                                            • package
                                                                                                                                                                                            • +
                                                                                                                                                                                            • private
                                                                                                                                                                                            • +
                                                                                                                                                                                            • protected
                                                                                                                                                                                            • +
                                                                                                                                                                                            • public
                                                                                                                                                                                            • return
                                                                                                                                                                                            • +
                                                                                                                                                                                            • short
                                                                                                                                                                                            • +
                                                                                                                                                                                            • static
                                                                                                                                                                                            • +
                                                                                                                                                                                            • strictfp
                                                                                                                                                                                            • +
                                                                                                                                                                                            • stringutil
                                                                                                                                                                                            • +
                                                                                                                                                                                            • super
                                                                                                                                                                                            • +
                                                                                                                                                                                            • switch
                                                                                                                                                                                            • +
                                                                                                                                                                                            • synchronized
                                                                                                                                                                                            • +
                                                                                                                                                                                            • this
                                                                                                                                                                                            • +
                                                                                                                                                                                            • throw
                                                                                                                                                                                            • +
                                                                                                                                                                                            • throws
                                                                                                                                                                                            • +
                                                                                                                                                                                            • transient
                                                                                                                                                                                            • +
                                                                                                                                                                                            • try
                                                                                                                                                                                            • +
                                                                                                                                                                                            • void
                                                                                                                                                                                            • +
                                                                                                                                                                                            • volatile
                                                                                                                                                                                            • +
                                                                                                                                                                                            • while
                                                                                                                                                                                            diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index d930e4c07930..d1851341f62b 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -5,71 +5,71 @@ sidebar_label: jaxrs-jersey | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                            **joda**
                                                                                                                                                                                            Joda (for legacy app only)
                                                                                                                                                                                            **legacy**
                                                                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                            **java8-localdatetime**
                                                                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                            **java8**
                                                                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                            **threetenbp**
                                                                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                            |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                            **joda**
                                                                                                                                                                                            Joda (for legacy app only)
                                                                                                                                                                                            **legacy**
                                                                                                                                                                                            Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                            **java8-localdatetime**
                                                                                                                                                                                            Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                            **java8**
                                                                                                                                                                                            Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                            **threetenbp**
                                                                                                                                                                                            Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                            |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                            **true**
                                                                                                                                                                                            Use Java 8 classes such as Base64
                                                                                                                                                                                            **false**
                                                                                                                                                                                            Various third party libraries as needed
                                                                                                                                                                                            |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|library|library template (sub-template)|
                                                                                                                                                                                            **jersey1**
                                                                                                                                                                                            Jersey core 1.x
                                                                                                                                                                                            **jersey2**
                                                                                                                                                                                            Jersey core 2.x
                                                                                                                                                                                            |jersey2| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                            **true**
                                                                                                                                                                                            Use a SnapShot Version
                                                                                                                                                                                            **false**
                                                                                                                                                                                            Use a Release Version
                                                                                                                                                                                            |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/main/java| +|supportJava6|Whether to support Java6 with the Jersey1/2 library.| |false| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|library|library template (sub-template)|
                                                                                                                                                                                            **jersey1**
                                                                                                                                                                                            Jersey core 1.x
                                                                                                                                                                                            **jersey2**
                                                                                                                                                                                            Jersey core 2.x
                                                                                                                                                                                            |jersey2| -|supportJava6|Whether to support Java6 with the Jersey1/2 library.| |false| |useTags|use tags for creating interface and controller classnames| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -82,87 +82,87 @@ sidebar_label: jaxrs-jersey ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                            • Integer
                                                                                                                                                                                            • -
                                                                                                                                                                                            • byte[]
                                                                                                                                                                                            • +
                                                                                                                                                                                              • Boolean
                                                                                                                                                                                              • +
                                                                                                                                                                                              • Double
                                                                                                                                                                                              • Float
                                                                                                                                                                                              • -
                                                                                                                                                                                              • boolean
                                                                                                                                                                                              • +
                                                                                                                                                                                              • Integer
                                                                                                                                                                                              • Long
                                                                                                                                                                                              • Object
                                                                                                                                                                                              • String
                                                                                                                                                                                              • -
                                                                                                                                                                                              • Boolean
                                                                                                                                                                                              • -
                                                                                                                                                                                              • Double
                                                                                                                                                                                              • +
                                                                                                                                                                                              • boolean
                                                                                                                                                                                              • +
                                                                                                                                                                                              • byte[]
                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                              • localvaraccepts
                                                                                                                                                                                              • -
                                                                                                                                                                                              • synchronized
                                                                                                                                                                                              • -
                                                                                                                                                                                              • do
                                                                                                                                                                                              • -
                                                                                                                                                                                              • float
                                                                                                                                                                                              • -
                                                                                                                                                                                              • while
                                                                                                                                                                                              • -
                                                                                                                                                                                              • localvarpath
                                                                                                                                                                                              • -
                                                                                                                                                                                              • protected
                                                                                                                                                                                              • -
                                                                                                                                                                                              • continue
                                                                                                                                                                                              • -
                                                                                                                                                                                              • else
                                                                                                                                                                                              • +
                                                                                                                                                                                                • abstract
                                                                                                                                                                                                • apiclient
                                                                                                                                                                                                • -
                                                                                                                                                                                                • localvarqueryparams
                                                                                                                                                                                                • -
                                                                                                                                                                                                • catch
                                                                                                                                                                                                • -
                                                                                                                                                                                                • if
                                                                                                                                                                                                • +
                                                                                                                                                                                                • apiexception
                                                                                                                                                                                                • +
                                                                                                                                                                                                • apiresponse
                                                                                                                                                                                                • +
                                                                                                                                                                                                • assert
                                                                                                                                                                                                • +
                                                                                                                                                                                                • boolean
                                                                                                                                                                                                • +
                                                                                                                                                                                                • break
                                                                                                                                                                                                • +
                                                                                                                                                                                                • byte
                                                                                                                                                                                                • case
                                                                                                                                                                                                • -
                                                                                                                                                                                                • new
                                                                                                                                                                                                • -
                                                                                                                                                                                                • package
                                                                                                                                                                                                • -
                                                                                                                                                                                                • static
                                                                                                                                                                                                • -
                                                                                                                                                                                                • void
                                                                                                                                                                                                • -
                                                                                                                                                                                                • localvaraccept
                                                                                                                                                                                                • +
                                                                                                                                                                                                • catch
                                                                                                                                                                                                • +
                                                                                                                                                                                                • char
                                                                                                                                                                                                • +
                                                                                                                                                                                                • class
                                                                                                                                                                                                • +
                                                                                                                                                                                                • configuration
                                                                                                                                                                                                • +
                                                                                                                                                                                                • const
                                                                                                                                                                                                • +
                                                                                                                                                                                                • continue
                                                                                                                                                                                                • +
                                                                                                                                                                                                • default
                                                                                                                                                                                                • +
                                                                                                                                                                                                • do
                                                                                                                                                                                                • double
                                                                                                                                                                                                • -
                                                                                                                                                                                                • byte
                                                                                                                                                                                                • -
                                                                                                                                                                                                • finally
                                                                                                                                                                                                • -
                                                                                                                                                                                                • this
                                                                                                                                                                                                • -
                                                                                                                                                                                                • strictfp
                                                                                                                                                                                                • -
                                                                                                                                                                                                • throws
                                                                                                                                                                                                • +
                                                                                                                                                                                                • else
                                                                                                                                                                                                • enum
                                                                                                                                                                                                • extends
                                                                                                                                                                                                • -
                                                                                                                                                                                                • null
                                                                                                                                                                                                • -
                                                                                                                                                                                                • transient
                                                                                                                                                                                                • -
                                                                                                                                                                                                • apiexception
                                                                                                                                                                                                • final
                                                                                                                                                                                                • -
                                                                                                                                                                                                • try
                                                                                                                                                                                                • -
                                                                                                                                                                                                • object
                                                                                                                                                                                                • -
                                                                                                                                                                                                • localvarcontenttypes
                                                                                                                                                                                                • +
                                                                                                                                                                                                • finally
                                                                                                                                                                                                • +
                                                                                                                                                                                                • float
                                                                                                                                                                                                • +
                                                                                                                                                                                                • for
                                                                                                                                                                                                • +
                                                                                                                                                                                                • goto
                                                                                                                                                                                                • +
                                                                                                                                                                                                • if
                                                                                                                                                                                                • implements
                                                                                                                                                                                                • -
                                                                                                                                                                                                • private
                                                                                                                                                                                                • import
                                                                                                                                                                                                • -
                                                                                                                                                                                                • const
                                                                                                                                                                                                • -
                                                                                                                                                                                                • configuration
                                                                                                                                                                                                • -
                                                                                                                                                                                                • for
                                                                                                                                                                                                • -
                                                                                                                                                                                                • apiresponse
                                                                                                                                                                                                • +
                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                • +
                                                                                                                                                                                                • int
                                                                                                                                                                                                • interface
                                                                                                                                                                                                • -
                                                                                                                                                                                                • long
                                                                                                                                                                                                • -
                                                                                                                                                                                                • switch
                                                                                                                                                                                                • -
                                                                                                                                                                                                • default
                                                                                                                                                                                                • -
                                                                                                                                                                                                • goto
                                                                                                                                                                                                • -
                                                                                                                                                                                                • public
                                                                                                                                                                                                • -
                                                                                                                                                                                                • localvarheaderparams
                                                                                                                                                                                                • -
                                                                                                                                                                                                • native
                                                                                                                                                                                                • -
                                                                                                                                                                                                • localvarcontenttype
                                                                                                                                                                                                • -
                                                                                                                                                                                                • assert
                                                                                                                                                                                                • -
                                                                                                                                                                                                • stringutil
                                                                                                                                                                                                • -
                                                                                                                                                                                                • class
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localreturntype
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvaraccept
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvaraccepts
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvarauthnames
                                                                                                                                                                                                • localvarcollectionqueryparams
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvarcontenttype
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvarcontenttypes
                                                                                                                                                                                                • localvarcookieparams
                                                                                                                                                                                                • -
                                                                                                                                                                                                • localreturntype
                                                                                                                                                                                                • localvarformparams
                                                                                                                                                                                                • -
                                                                                                                                                                                                • break
                                                                                                                                                                                                • -
                                                                                                                                                                                                • volatile
                                                                                                                                                                                                • -
                                                                                                                                                                                                • localvarauthnames
                                                                                                                                                                                                • -
                                                                                                                                                                                                • abstract
                                                                                                                                                                                                • -
                                                                                                                                                                                                • int
                                                                                                                                                                                                • -
                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                • -
                                                                                                                                                                                                • super
                                                                                                                                                                                                • -
                                                                                                                                                                                                • boolean
                                                                                                                                                                                                • -
                                                                                                                                                                                                • throw
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvarheaderparams
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvarpath
                                                                                                                                                                                                • localvarpostbody
                                                                                                                                                                                                • -
                                                                                                                                                                                                • char
                                                                                                                                                                                                • -
                                                                                                                                                                                                • short
                                                                                                                                                                                                • +
                                                                                                                                                                                                • localvarqueryparams
                                                                                                                                                                                                • +
                                                                                                                                                                                                • long
                                                                                                                                                                                                • +
                                                                                                                                                                                                • native
                                                                                                                                                                                                • +
                                                                                                                                                                                                • new
                                                                                                                                                                                                • +
                                                                                                                                                                                                • null
                                                                                                                                                                                                • +
                                                                                                                                                                                                • object
                                                                                                                                                                                                • +
                                                                                                                                                                                                • package
                                                                                                                                                                                                • +
                                                                                                                                                                                                • private
                                                                                                                                                                                                • +
                                                                                                                                                                                                • protected
                                                                                                                                                                                                • +
                                                                                                                                                                                                • public
                                                                                                                                                                                                • return
                                                                                                                                                                                                • +
                                                                                                                                                                                                • short
                                                                                                                                                                                                • +
                                                                                                                                                                                                • static
                                                                                                                                                                                                • +
                                                                                                                                                                                                • strictfp
                                                                                                                                                                                                • +
                                                                                                                                                                                                • stringutil
                                                                                                                                                                                                • +
                                                                                                                                                                                                • super
                                                                                                                                                                                                • +
                                                                                                                                                                                                • switch
                                                                                                                                                                                                • +
                                                                                                                                                                                                • synchronized
                                                                                                                                                                                                • +
                                                                                                                                                                                                • this
                                                                                                                                                                                                • +
                                                                                                                                                                                                • throw
                                                                                                                                                                                                • +
                                                                                                                                                                                                • throws
                                                                                                                                                                                                • +
                                                                                                                                                                                                • transient
                                                                                                                                                                                                • +
                                                                                                                                                                                                • try
                                                                                                                                                                                                • +
                                                                                                                                                                                                • void
                                                                                                                                                                                                • +
                                                                                                                                                                                                • volatile
                                                                                                                                                                                                • +
                                                                                                                                                                                                • while
                                                                                                                                                                                                diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 905c30e52ff5..378769bd75f9 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -5,71 +5,70 @@ sidebar_label: jaxrs-resteasy-eap | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-resteasy-eap-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                **joda**
                                                                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                                                                **legacy**
                                                                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                **java8-localdatetime**
                                                                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                **java8**
                                                                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                **threetenbp**
                                                                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                **joda**
                                                                                                                                                                                                Joda (for legacy app only)
                                                                                                                                                                                                **legacy**
                                                                                                                                                                                                Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                **java8-localdatetime**
                                                                                                                                                                                                Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                **java8**
                                                                                                                                                                                                Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                **threetenbp**
                                                                                                                                                                                                Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                                **true**
                                                                                                                                                                                                Use Java 8 classes such as Base64
                                                                                                                                                                                                **false**
                                                                                                                                                                                                Various third party libraries as needed
                                                                                                                                                                                                |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                                **true**
                                                                                                                                                                                                Use a SnapShot Version
                                                                                                                                                                                                **false**
                                                                                                                                                                                                Use a Release Version
                                                                                                                                                                                                |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/main/java| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|useBeanValidation|Use BeanValidation API annotations| |true| -|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true| |useSwaggerFeature|Use dynamic Swagger generator| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -82,87 +81,87 @@ sidebar_label: jaxrs-resteasy-eap ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                • Integer
                                                                                                                                                                                                • -
                                                                                                                                                                                                • byte[]
                                                                                                                                                                                                • +
                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                  • +
                                                                                                                                                                                                  • Double
                                                                                                                                                                                                  • Float
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                  • +
                                                                                                                                                                                                  • Integer
                                                                                                                                                                                                  • Long
                                                                                                                                                                                                  • Object
                                                                                                                                                                                                  • String
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • Double
                                                                                                                                                                                                  • +
                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                  • +
                                                                                                                                                                                                  • byte[]
                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                  • localvaraccepts
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • synchronized
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • do
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • float
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • while
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • localvarpath
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • protected
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • continue
                                                                                                                                                                                                  • -
                                                                                                                                                                                                  • else
                                                                                                                                                                                                  • +
                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                    • apiclient
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • localvarqueryparams
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • catch
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • if
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • apiexception
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • apiresponse
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • assert
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • break
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • byte
                                                                                                                                                                                                    • case
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • new
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • package
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • static
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • void
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • localvaraccept
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • catch
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • char
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • class
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • configuration
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • const
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • continue
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • default
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • do
                                                                                                                                                                                                    • double
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • byte
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • finally
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • this
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • strictfp
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • throws
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • else
                                                                                                                                                                                                    • enum
                                                                                                                                                                                                    • extends
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • null
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • transient
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • apiexception
                                                                                                                                                                                                    • final
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • try
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • object
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • finally
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • float
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • for
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • goto
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • if
                                                                                                                                                                                                    • implements
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • private
                                                                                                                                                                                                    • import
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • const
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • configuration
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • for
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • apiresponse
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • int
                                                                                                                                                                                                    • interface
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • long
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • switch
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • default
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • goto
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • public
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • localvarheaderparams
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • native
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • localvarcontenttype
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • assert
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • stringutil
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • class
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localreturntype
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvaraccept
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvaraccepts
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvarauthnames
                                                                                                                                                                                                    • localvarcollectionqueryparams
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvarcontenttype
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvarcontenttypes
                                                                                                                                                                                                    • localvarcookieparams
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • localreturntype
                                                                                                                                                                                                    • localvarformparams
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • break
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • volatile
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • localvarauthnames
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • int
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • super
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • throw
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvarheaderparams
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvarpath
                                                                                                                                                                                                    • localvarpostbody
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • char
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • short
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • localvarqueryparams
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • long
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • native
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • new
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • null
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • object
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • package
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • private
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • protected
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • public
                                                                                                                                                                                                    • return
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • short
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • static
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • strictfp
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • stringutil
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • super
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • switch
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • synchronized
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • this
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • throw
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • throws
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • transient
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • try
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • void
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • volatile
                                                                                                                                                                                                    • +
                                                                                                                                                                                                    • while
                                                                                                                                                                                                    diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index cec7263ce521..9b85ad5e172a 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -5,69 +5,69 @@ sidebar_label: jaxrs-resteasy | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-resteasy-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                    **joda**
                                                                                                                                                                                                    Joda (for legacy app only)
                                                                                                                                                                                                    **legacy**
                                                                                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                    **java8-localdatetime**
                                                                                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                    **java8**
                                                                                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                    **threetenbp**
                                                                                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                    |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                    **joda**
                                                                                                                                                                                                    Joda (for legacy app only)
                                                                                                                                                                                                    **legacy**
                                                                                                                                                                                                    Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                    **java8-localdatetime**
                                                                                                                                                                                                    Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                    **java8**
                                                                                                                                                                                                    Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                    **threetenbp**
                                                                                                                                                                                                    Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                    |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                                    **true**
                                                                                                                                                                                                    Use Java 8 classes such as Base64
                                                                                                                                                                                                    **false**
                                                                                                                                                                                                    Various third party libraries as needed
                                                                                                                                                                                                    |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                                    **true**
                                                                                                                                                                                                    Use a SnapShot Version
                                                                                                                                                                                                    **false**
                                                                                                                                                                                                    Use a Release Version
                                                                                                                                                                                                    |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/main/java| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -80,87 +80,87 @@ sidebar_label: jaxrs-resteasy ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                    • Integer
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • byte[]
                                                                                                                                                                                                    • +
                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                      • +
                                                                                                                                                                                                      • Double
                                                                                                                                                                                                      • Float
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                      • +
                                                                                                                                                                                                      • Integer
                                                                                                                                                                                                      • Long
                                                                                                                                                                                                      • Object
                                                                                                                                                                                                      • String
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • Double
                                                                                                                                                                                                      • +
                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                      • +
                                                                                                                                                                                                      • byte[]
                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                      • localvaraccepts
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • synchronized
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • do
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • float
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • while
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • localvarpath
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • protected
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • continue
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • else
                                                                                                                                                                                                      • +
                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                        • apiclient
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • localvarqueryparams
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • catch
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • if
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • apiexception
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • apiresponse
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • assert
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • boolean
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • break
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • byte
                                                                                                                                                                                                        • case
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • new
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • package
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • static
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • void
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • localvaraccept
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • catch
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • char
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • class
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • configuration
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • const
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • continue
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • default
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • do
                                                                                                                                                                                                        • double
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • byte
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • finally
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • this
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • strictfp
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • throws
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • else
                                                                                                                                                                                                        • enum
                                                                                                                                                                                                        • extends
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • null
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • transient
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • apiexception
                                                                                                                                                                                                        • final
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • try
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • object
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • localvarcontenttypes
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • finally
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • float
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • for
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • goto
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • if
                                                                                                                                                                                                        • implements
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • private
                                                                                                                                                                                                        • import
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • const
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • configuration
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • for
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • apiresponse
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • int
                                                                                                                                                                                                        • interface
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • long
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • switch
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • default
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • goto
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • public
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • localvarheaderparams
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • native
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • localvarcontenttype
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • assert
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • stringutil
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • class
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localreturntype
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvaraccept
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvaraccepts
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvarauthnames
                                                                                                                                                                                                        • localvarcollectionqueryparams
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvarcontenttype
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvarcontenttypes
                                                                                                                                                                                                        • localvarcookieparams
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • localreturntype
                                                                                                                                                                                                        • localvarformparams
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • break
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • volatile
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • localvarauthnames
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • int
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • super
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • boolean
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • throw
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvarheaderparams
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvarpath
                                                                                                                                                                                                        • localvarpostbody
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • char
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • short
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • localvarqueryparams
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • long
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • native
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • new
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • null
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • object
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • package
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • private
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • protected
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • public
                                                                                                                                                                                                        • return
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • short
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • static
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • strictfp
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • stringutil
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • super
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • switch
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • synchronized
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • this
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • throw
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • throws
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • transient
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • try
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • void
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • volatile
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • while
                                                                                                                                                                                                        diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 6804b06c4ad7..d9c32ce88abd 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -5,74 +5,74 @@ sidebar_label: jaxrs-spec | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-jaxrs-server| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                        **joda**
                                                                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                                                                        **legacy**
                                                                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                        **java8**
                                                                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                        |legacy| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|generatePom|Whether to generate pom.xml if the file does not already exist.| |true| +|groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                        **joda**
                                                                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                                                                        **legacy**
                                                                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                        **java8**
                                                                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                        |legacy| +|implFolder|folder for generated implementation code| |src/main/java| +|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                                        **true**
                                                                                                                                                                                                        Use Java 8 classes such as Base64
                                                                                                                                                                                                        **false**
                                                                                                                                                                                                        Various third party libraries as needed
                                                                                                                                                                                                        |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|library|library template (sub-template)|
                                                                                                                                                                                                        **<default>**
                                                                                                                                                                                                        JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
                                                                                                                                                                                                        **quarkus**
                                                                                                                                                                                                        Server using Quarkus
                                                                                                                                                                                                        **thorntail**
                                                                                                                                                                                                        Server using Thorntail
                                                                                                                                                                                                        **openliberty**
                                                                                                                                                                                                        Server using Open Liberty
                                                                                                                                                                                                        **helidon**
                                                                                                                                                                                                        Server using Helidon
                                                                                                                                                                                                        |<default>| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| +|openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serverPort|The port on which the server should be started| |8080| |snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                                        **true**
                                                                                                                                                                                                        Use a SnapShot Version
                                                                                                                                                                                                        **false**
                                                                                                                                                                                                        Use a Release Version
                                                                                                                                                                                                        |null| -|implFolder|folder for generated implementation code| |src/main/java| +|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| |src/main/java| |title|a title describing the application| |OpenAPI Server| |useBeanValidation|Use BeanValidation API annotations| |true| -|serverPort|The port on which the server should be started| |8080| -|library|library template (sub-template)|
                                                                                                                                                                                                        **<default>**
                                                                                                                                                                                                        JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
                                                                                                                                                                                                        **quarkus**
                                                                                                                                                                                                        Server using Quarkus
                                                                                                                                                                                                        **thorntail**
                                                                                                                                                                                                        Server using Thorntail
                                                                                                                                                                                                        **openliberty**
                                                                                                                                                                                                        Server using Open Liberty
                                                                                                                                                                                                        **helidon**
                                                                                                                                                                                                        Server using Helidon
                                                                                                                                                                                                        |<default>| -|generatePom|Whether to generate pom.xml if the file does not already exist.| |true| -|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| -|returnResponse|Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.| |false| |useSwaggerAnnotations|Whether to generate Swagger annotations.| |true| -|openApiSpecFileLocation|Location where the file containing the spec will be generated in the output folder. No file generated when set to null or empty string.| |null| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.LocalDate| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -85,87 +85,87 @@ sidebar_label: jaxrs-spec ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                        • Integer
                                                                                                                                                                                                        • -
                                                                                                                                                                                                        • byte[]
                                                                                                                                                                                                        • +
                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                          • +
                                                                                                                                                                                                          • Double
                                                                                                                                                                                                          • Float
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                          • +
                                                                                                                                                                                                          • Integer
                                                                                                                                                                                                          • Long
                                                                                                                                                                                                          • Object
                                                                                                                                                                                                          • String
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • Double
                                                                                                                                                                                                          • +
                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                          • +
                                                                                                                                                                                                          • byte[]
                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                          • localvaraccepts
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • synchronized
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • do
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • float
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • while
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • localvarpath
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • protected
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • continue
                                                                                                                                                                                                          • -
                                                                                                                                                                                                          • else
                                                                                                                                                                                                          • +
                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                            • apiclient
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • localvarqueryparams
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • catch
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • if
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • apiexception
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • apiresponse
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • assert
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • break
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • byte
                                                                                                                                                                                                            • case
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • new
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • package
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • static
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • void
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • localvaraccept
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • catch
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • char
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • class
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • configuration
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • const
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • continue
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • default
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • do
                                                                                                                                                                                                            • double
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • byte
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • finally
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • this
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • strictfp
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • throws
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • else
                                                                                                                                                                                                            • enum
                                                                                                                                                                                                            • extends
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • null
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • transient
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • apiexception
                                                                                                                                                                                                            • final
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • try
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • object
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • finally
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • float
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • for
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • goto
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • if
                                                                                                                                                                                                            • implements
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • private
                                                                                                                                                                                                            • import
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • const
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • configuration
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • for
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • apiresponse
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • int
                                                                                                                                                                                                            • interface
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • long
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • switch
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • default
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • goto
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • public
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • localvarheaderparams
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • native
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • localvarcontenttype
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • assert
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • stringutil
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • class
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localreturntype
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvaraccept
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvaraccepts
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvarauthnames
                                                                                                                                                                                                            • localvarcollectionqueryparams
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvarcontenttype
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                                                                            • localvarcookieparams
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • localreturntype
                                                                                                                                                                                                            • localvarformparams
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • break
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • volatile
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • localvarauthnames
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • int
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • super
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • throw
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvarheaderparams
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvarpath
                                                                                                                                                                                                            • localvarpostbody
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • char
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • short
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • localvarqueryparams
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • long
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • native
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • new
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • null
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • object
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • package
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • private
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • protected
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • public
                                                                                                                                                                                                            • return
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • short
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • static
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • strictfp
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • stringutil
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • super
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • switch
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • synchronized
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • this
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • throw
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • throws
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • transient
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • try
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • void
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • volatile
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            • while
                                                                                                                                                                                                            diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 823e0a59a1af..2aff0efbb2bd 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -5,32 +5,32 @@ sidebar_label: jmeter | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index f4fdcf2a4115..cffcda881f88 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -5,40 +5,40 @@ sidebar_label: kotlin-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sourceFolder|source folder for generated code| |src/main/kotlin| -|packageName|Generated artifact package name.| |org.openapitools.server| |apiSuffix|suffix for api classes| |Api| -|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |artifactId|Generated artifact id (name of jar).| |kotlin-server| |artifactVersion|Generated artifact's package version.| |1.0.0| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| -|parcelizeModels|toggle "@Parcelize" for generated models| |null| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| -|modelMutable|Create mutable models| |false| -|library|library template (sub-template)|
                                                                                                                                                                                                            **ktor**
                                                                                                                                                                                                            ktor framework
                                                                                                                                                                                                            |ktor| |featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true| -|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false| -|featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true| |featureCORS|Ktor by default provides an interceptor for implementing proper support for Cross-Origin Resource Sharing (CORS). See enable-cors.org.| |false| |featureCompression|Adds ability to compress outgoing content using gzip, deflate or custom encoder and thus reduce size of the response.| |true| +|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false| +|featureHSTS|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |true| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|library|library template (sub-template)|
                                                                                                                                                                                                            **ktor**
                                                                                                                                                                                                            ktor framework
                                                                                                                                                                                                            |ktor| +|modelMutable|Create mutable models| |false| +|packageName|Generated artifact package name.| |org.openapitools.server| +|parcelizeModels|toggle "@Parcelize" for generated models| |null| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |null| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|sourceFolder|source folder for generated code| |src/main/kotlin| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|java.time.LocalDateTime| -|LocalTime|java.time.LocalTime| -|UUID|java.util.UUID| -|URI|java.net.URI| -|File|java.io.File| -|Timestamp|java.sql.Timestamp| -|LocalDate|java.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|java.time.LocalDateTime| +|File|java.io.File| +|LocalDate|java.time.LocalDate| +|LocalDateTime|java.time.LocalDateTime| +|LocalTime|java.time.LocalTime| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -52,50 +52,50 @@ sidebar_label: kotlin-server ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                            • kotlin.collections.List
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • kotlin.Float
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • kotlin.Double
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • kotlin.String
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • kotlin.Array
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • kotlin.Byte
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • kotlin.collections.Map
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • kotlin.Short
                                                                                                                                                                                                            • +
                                                                                                                                                                                                              • kotlin.Array
                                                                                                                                                                                                              • kotlin.Boolean
                                                                                                                                                                                                              • -
                                                                                                                                                                                                              • kotlin.Long
                                                                                                                                                                                                              • -
                                                                                                                                                                                                              • kotlin.Char
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.Byte
                                                                                                                                                                                                              • kotlin.ByteArray
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.Char
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.Double
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.Float
                                                                                                                                                                                                              • kotlin.Int
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.Long
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.Short
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.String
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.collections.List
                                                                                                                                                                                                              • +
                                                                                                                                                                                                              • kotlin.collections.Map
                                                                                                                                                                                                              • kotlin.collections.Set
                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                              • for
                                                                                                                                                                                                              • -
                                                                                                                                                                                                              • do
                                                                                                                                                                                                              • -
                                                                                                                                                                                                              • interface
                                                                                                                                                                                                              • -
                                                                                                                                                                                                              • while
                                                                                                                                                                                                              • -
                                                                                                                                                                                                              • when
                                                                                                                                                                                                              • +
                                                                                                                                                                                                                • as
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • break
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • class
                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • do
                                                                                                                                                                                                                • else
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • typealias
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • class
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • false
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • for
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • fun
                                                                                                                                                                                                                • if
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • typeof
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • val
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • package
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • break
                                                                                                                                                                                                                • in
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • var
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • false
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • this
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                • is
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • super
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • as
                                                                                                                                                                                                                • null
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • object
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • package
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • return
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • super
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • this
                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                • true
                                                                                                                                                                                                                • try
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • fun
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • return
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • object
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • typealias
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • typeof
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • val
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • var
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • when
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                • while
                                                                                                                                                                                                                diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index b89ee519a596..11d7a924b2d2 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -5,49 +5,49 @@ sidebar_label: kotlin-spring | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sourceFolder|source folder for generated code| |src/main/kotlin| -|packageName|Generated artifact package name.| |org.openapitools| +|apiPackage|api package for generated code| |org.openapitools.api| |apiSuffix|suffix for api classes| |Api| -|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |artifactId|Generated artifact id (name of jar).| |openapi-spring| |artifactVersion|Generated artifact's package version.| |1.0.0| +|basePackage|base package (invokerPackage) for generated code| |org.openapitools| +|delegatePattern|Whether to generate the server files using the delegate pattern| |false| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|exceptionHandler|generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )| |true| +|gradleBuildFile|generate a gradle build file using the Kotlin DSL| |true| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| +|library|library template (sub-template)|
                                                                                                                                                                                                                **spring-boot**
                                                                                                                                                                                                                Spring-boot Server application.
                                                                                                                                                                                                                |spring-boot| +|modelMutable|Create mutable models| |false| +|modelPackage|model package for generated code| |org.openapitools.model| +|packageName|Generated artifact package name.| |org.openapitools| |parcelizeModels|toggle "@Parcelize" for generated models| |null| +|reactive|use coroutines for reactive behavior| |false| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| -|modelMutable|Create mutable models| |false| -|title|server title name or client service name| |OpenAPI Kotlin Spring| -|basePackage|base package (invokerPackage) for generated code| |org.openapitools| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |serverPort|configuration the port in which the sever is to run on| |8080| -|modelPackage|model package for generated code| |org.openapitools.model| -|apiPackage|api package for generated code| |org.openapitools.api| -|exceptionHandler|generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )| |true| -|gradleBuildFile|generate a gradle build file using the Kotlin DSL| |true| -|swaggerAnnotations|generate swagger annotations to go alongside controllers and models| |false| -|serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false| |serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false| +|serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|sourceFolder|source folder for generated code| |src/main/kotlin| +|swaggerAnnotations|generate swagger annotations to go alongside controllers and models| |false| +|title|server title name or client service name| |OpenAPI Kotlin Spring| |useBeanValidation|Use BeanValidation API annotations to validate data types| |true| -|reactive|use coroutines for reactive behavior| |false| -|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| -|delegatePattern|Whether to generate the server files using the delegate pattern| |false| -|library|library template (sub-template)|
                                                                                                                                                                                                                **spring-boot**
                                                                                                                                                                                                                Spring-boot Server application.
                                                                                                                                                                                                                |spring-boot| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|java.time.LocalDateTime| -|LocalTime|java.time.LocalTime| -|UUID|java.util.UUID| -|URI|java.net.URI| -|File|java.io.File| -|Timestamp|java.sql.Timestamp| -|LocalDate|java.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.time.LocalDate| |DateTime|java.time.OffsetDateTime| +|File|java.io.File| +|LocalDate|java.time.LocalDate| +|LocalDateTime|java.time.LocalDateTime| +|LocalTime|java.time.LocalTime| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -61,53 +61,53 @@ sidebar_label: kotlin-spring ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                • kotlin.collections.List
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • kotlin.Float
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • kotlin.Double
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • kotlin.String
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • kotlin.Array
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • kotlin.Byte
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • kotlin.collections.Map
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • kotlin.Short
                                                                                                                                                                                                                • +
                                                                                                                                                                                                                  • kotlin.Array
                                                                                                                                                                                                                  • kotlin.Boolean
                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                  • kotlin.Long
                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                  • kotlin.Char
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.Byte
                                                                                                                                                                                                                  • kotlin.ByteArray
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.Char
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.Double
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.Float
                                                                                                                                                                                                                  • kotlin.Int
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.Long
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.Short
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.String
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.collections.List
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • kotlin.collections.Map
                                                                                                                                                                                                                  • kotlin.collections.Set
                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                  • for
                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                  • do
                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                  • interface
                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                  • when
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                    • ApiClient
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • ApiException
                                                                                                                                                                                                                    • ApiResponse
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • typealias
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • fun
                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • typeof
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • val
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                    • is
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • ApiClient
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • object
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • fun
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • object
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • ApiException
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • typealias
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • typeof
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • val
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • when
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                    diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 07d1b61ef101..20a85045d089 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -5,34 +5,34 @@ sidebar_label: kotlin-vertx | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sourceFolder|source folder for generated code| |src/main/kotlin| -|packageName|Generated artifact package name.| |org.openapitools| |apiSuffix|suffix for api classes| |Api| -|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |artifactId|Generated artifact id (name of jar).| |null| |artifactVersion|Generated artifact's package version.| |1.0.0| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|modelMutable|Create mutable models| |false| +|packageName|Generated artifact package name.| |org.openapitools| |parcelizeModels|toggle "@Parcelize" for generated models| |null| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| -|modelMutable|Create mutable models| |false| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|sourceFolder|source folder for generated code| |src/main/kotlin| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|java.time.LocalDateTime| -|LocalTime|java.time.LocalTime| -|UUID|java.util.UUID| -|URI|java.net.URI| -|File|java.io.File| -|Timestamp|java.sql.Timestamp| -|LocalDate|java.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|java.time.LocalDateTime| +|File|java.io.File| +|LocalDate|java.time.LocalDate| +|LocalDateTime|java.time.LocalDateTime| +|LocalTime|java.time.LocalTime| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -46,50 +46,50 @@ sidebar_label: kotlin-vertx ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                    • kotlin.collections.List
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • kotlin.Float
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • kotlin.Double
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • kotlin.String
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • kotlin.Array
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • kotlin.Byte
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • kotlin.collections.Map
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • kotlin.Short
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                      • kotlin.Array
                                                                                                                                                                                                                      • kotlin.Boolean
                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                      • kotlin.Long
                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                      • kotlin.Char
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.Byte
                                                                                                                                                                                                                      • kotlin.ByteArray
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.Char
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.Double
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.Float
                                                                                                                                                                                                                      • kotlin.Int
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.Long
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.Short
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.String
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.collections.List
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                      • kotlin.collections.Map
                                                                                                                                                                                                                      • kotlin.collections.Set
                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                      • for
                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                      • do
                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                      • interface
                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                      • while
                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                      • when
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • typealias
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • fun
                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • typeof
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • val
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                        • is
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • fun
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • typealias
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • typeof
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • val
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • when
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                        diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 27b430a29d99..2ef38896fd37 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -5,38 +5,38 @@ sidebar_label: kotlin | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sourceFolder|source folder for generated code| |src/main/kotlin| -|packageName|Generated artifact package name.| |org.openapitools.client| |apiSuffix|suffix for api classes| |Api| -|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |artifactId|Generated artifact id (name of jar).| |kotlin-client| |artifactVersion|Generated artifact's package version.| |1.0.0| +|collectionType|Option. Collection type to use|
                                                                                                                                                                                                                        **array**
                                                                                                                                                                                                                        kotlin.Array
                                                                                                                                                                                                                        **list**
                                                                                                                                                                                                                        kotlin.collections.List
                                                                                                                                                                                                                        |array| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                                        **threetenbp-localdatetime**
                                                                                                                                                                                                                        Threetenbp - Backport of JSR310 (jvm only, for legacy app only)
                                                                                                                                                                                                                        **string**
                                                                                                                                                                                                                        String
                                                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                                                        Java 8 native JSR310 (jvm only, for legacy app only)
                                                                                                                                                                                                                        **java8**
                                                                                                                                                                                                                        Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)
                                                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                                                        Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)
                                                                                                                                                                                                                        |java8| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| -|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| +|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| +|library|Library template (sub-template) to use|
                                                                                                                                                                                                                        **jvm-okhttp4**
                                                                                                                                                                                                                        [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
                                                                                                                                                                                                                        **jvm-okhttp3**
                                                                                                                                                                                                                        Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
                                                                                                                                                                                                                        **jvm-retrofit2**
                                                                                                                                                                                                                        Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
                                                                                                                                                                                                                        **multiplatform**
                                                                                                                                                                                                                        Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.
                                                                                                                                                                                                                        |jvm-okhttp4| +|modelMutable|Create mutable models| |false| +|packageName|Generated artifact package name.| |org.openapitools.client| |parcelizeModels|toggle "@Parcelize" for generated models| |null| +|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
                                                                                                                                                                                                                        **toJson**
                                                                                                                                                                                                                        Date formater option using a json converter.
                                                                                                                                                                                                                        **toString**
                                                                                                                                                                                                                        [DEFAULT] Use the 'toString'-method of the date-time object to retrieve the related string representation.
                                                                                                                                                                                                                        |toString| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null| -|modelMutable|Create mutable models| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                                        **threetenbp-localdatetime**
                                                                                                                                                                                                                        Threetenbp - Backport of JSR310 (jvm only, for legacy app only)
                                                                                                                                                                                                                        **string**
                                                                                                                                                                                                                        String
                                                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                                                        Java 8 native JSR310 (jvm only, for legacy app only)
                                                                                                                                                                                                                        **java8**
                                                                                                                                                                                                                        Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)
                                                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                                                        Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)
                                                                                                                                                                                                                        |java8| -|collectionType|Option. Collection type to use|
                                                                                                                                                                                                                        **array**
                                                                                                                                                                                                                        kotlin.Array
                                                                                                                                                                                                                        **list**
                                                                                                                                                                                                                        kotlin.collections.List
                                                                                                                                                                                                                        |array| -|library|Library template (sub-template) to use|
                                                                                                                                                                                                                        **jvm-okhttp4**
                                                                                                                                                                                                                        [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
                                                                                                                                                                                                                        **jvm-okhttp3**
                                                                                                                                                                                                                        Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
                                                                                                                                                                                                                        **jvm-retrofit2**
                                                                                                                                                                                                                        Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
                                                                                                                                                                                                                        **multiplatform**
                                                                                                                                                                                                                        Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.
                                                                                                                                                                                                                        |jvm-okhttp4| -|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|
                                                                                                                                                                                                                        **toJson**
                                                                                                                                                                                                                        Date formater option using a json converter.
                                                                                                                                                                                                                        **toString**
                                                                                                                                                                                                                        [DEFAULT] Use the 'toString'-method of the date-time object to retrieve the related string representation.
                                                                                                                                                                                                                        |toString| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| +|sourceFolder|source folder for generated code| |src/main/kotlin| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|java.time.LocalDateTime| -|LocalTime|java.time.LocalTime| -|UUID|java.util.UUID| -|URI|java.net.URI| -|File|java.io.File| -|Timestamp|java.sql.Timestamp| -|LocalDate|java.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|java.time.LocalDateTime| +|File|java.io.File| +|LocalDate|java.time.LocalDate| +|LocalDateTime|java.time.LocalDateTime| +|LocalTime|java.time.LocalTime| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -50,50 +50,50 @@ sidebar_label: kotlin ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                        • kotlin.collections.List
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • kotlin.Float
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • kotlin.Double
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • kotlin.String
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • kotlin.Array
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • kotlin.Byte
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • kotlin.collections.Map
                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                        • kotlin.Short
                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                          • kotlin.Array
                                                                                                                                                                                                                          • kotlin.Boolean
                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                          • kotlin.Long
                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                          • kotlin.Char
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.Byte
                                                                                                                                                                                                                          • kotlin.ByteArray
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.Char
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.Double
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.Float
                                                                                                                                                                                                                          • kotlin.Int
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.Long
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.Short
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.String
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.collections.List
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • kotlin.collections.Map
                                                                                                                                                                                                                          • kotlin.collections.Set
                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                          • for
                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                          • do
                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                          • interface
                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                          • while
                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                          • when
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • typealias
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • fun
                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • typeof
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • val
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                            • is
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • fun
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • typealias
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • typeof
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • val
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • when
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                            diff --git a/docs/generators/lua.md b/docs/generators/lua.md index a7d814198f64..406227033416 100644 --- a/docs/generators/lua.md +++ b/docs/generators/lua.md @@ -5,17 +5,17 @@ sidebar_label: lua | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |packageName|Lua package name (convention: single word).| |openapiclient| |packageVersion|Lua package version.| |1.0.0-1| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|time.Time|time| -|os|io/ioutil| |*os.File|os| +|os|io/ioutil| +|time.Time|time| ## INSTANTIATION TYPES @@ -26,39 +26,39 @@ sidebar_label: lua ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                            • nil
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                              • nil
                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                              • for
                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                • and
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • local
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • nil
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • number
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • userdata
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • not
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • and
                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                • elseif
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • repeat
                                                                                                                                                                                                                                • end
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • table
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • thread
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • local
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • nil
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • not
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • number
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • repeat
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • string
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • table
                                                                                                                                                                                                                                • then
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • thread
                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                • until
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • userdata
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 561bfa1cf235..3c7777b2a905 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -5,32 +5,32 @@ sidebar_label: markdown | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES diff --git a/docs/generators/mysql-schema.md b/docs/generators/mysql-schema.md index 5ed0960101f4..67e235168b31 100644 --- a/docs/generators/mysql-schema.md +++ b/docs/generators/mysql-schema.md @@ -6,8 +6,8 @@ sidebar_label: mysql-schema | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | |defaultDatabaseName|Default database name for all MySQL queries| || -|jsonDataTypeEnabled|Use special JSON MySQL data type for complex model properties. Requires MySQL version 5.7.8. Generates TEXT data type when disabled| |true| |identifierNamingConvention|Naming convention of MySQL identifiers(table names and column names). This is not related to database name which is defined by defaultDatabaseName option|
                                                                                                                                                                                                                                **original**
                                                                                                                                                                                                                                Do not transform original names
                                                                                                                                                                                                                                **snake_case**
                                                                                                                                                                                                                                Use snake_case names
                                                                                                                                                                                                                                |original| +|jsonDataTypeEnabled|Use special JSON MySQL data type for complex model properties. Requires MySQL version 5.7.8. Generates TEXT data type when disabled| |true| ## IMPORT MAPPING @@ -23,294 +23,294 @@ sidebar_label: mysql-schema ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                • date
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                  • BigDecimal
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • ByteArray
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • Date
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • DateTime
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • URI
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • UUID
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • binary
                                                                                                                                                                                                                                  • bool
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • double
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                  • byte
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • mixed
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • char
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • date
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • double
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • file
                                                                                                                                                                                                                                  • float
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • URI
                                                                                                                                                                                                                                  • int
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • Date
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • DateTime
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                  • long
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • BigDecimal
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • mixed
                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • file
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • binary
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • char
                                                                                                                                                                                                                                  • short
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • ByteArray
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • UUID
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                  • void
                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                  • dec
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • low_priority
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • references
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • leading
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • insensitive
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • ssl
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • character
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • int2
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • int1
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • io_after_gtids
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • trailing
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • int4
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • int3
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • utc_time
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • int8
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • optimizer_costs
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • rank
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • cube
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • databases
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • using
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • outer
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • require
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • then
                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                  • each
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                    • accessible
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • add
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • all
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • alter
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • analyze
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • left
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • unique
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • except
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • starting
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • schema
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • accessible
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • role
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • deterministic
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • into
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • smallint
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • dual
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • partition
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • varying
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • by
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • ntile
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • where
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • xor
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • persist
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • current_time
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • key
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • iterate
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • set
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • column
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • minute_microsecond
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • procedure
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • right
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • union
                                                                                                                                                                                                                                    • asc
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • asensitive
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • before
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • between
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • bigint
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • binary
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • blob
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • both
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • by
                                                                                                                                                                                                                                    • call
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • varbinary
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • longblob
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • describe
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • to
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • localtime
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sql_big_result
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • declare
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • empty
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • enclosed
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • div
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • generated
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • leave
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • loop
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • elseif
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • hour_second
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • row_number
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • signal
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • add
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • percent_rank
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • unlock
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • last_value
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • mediumtext
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • cascade
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • change
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • character
                                                                                                                                                                                                                                    • check
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • escaped
                                                                                                                                                                                                                                    • collate
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • schemas
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • persist_only
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • column
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • condition
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • constraint
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • convert
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • create
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • cross
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • cube
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • cume_dist
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • current_date
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • current_time
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • current_timestamp
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • current_user
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • cursor
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • database
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • databases
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • day_hour
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • day_microsecond
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • day_minute
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • day_second
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • dec
                                                                                                                                                                                                                                    • decimal
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • declare
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • delayed
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • dense_rank
                                                                                                                                                                                                                                    • desc
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • cursor
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • describe
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • deterministic
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • distinct
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • distinctrow
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • div
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                    • drop
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • virtual
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • asensitive
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • show
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • revoke
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • update
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • purge
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • not
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • undo
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • zerofill
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • json_table
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • load
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • straight_join
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • ignore
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • lines
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • over
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • mediumint
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • varchar
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • dual
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • each
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • elseif
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • empty
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • enclosed
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • escaped
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • except
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • exists
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • exit
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • explain
                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • dense_rank
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • mediumblob
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • window
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • fetch
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • first_value
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • float4
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • float8
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • force
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • foreign
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • from
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • fulltext
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • generated
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • get
                                                                                                                                                                                                                                    • grant
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • day_second
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • explain
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • maxvalue
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • mod
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • select
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • release
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • usage
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • optionally
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • middleint
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • delayed
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • convert
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • localtimestamp
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sql_small_result
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • when
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • cume_dist
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • lock
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • join
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • spatial
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • write
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • between
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sqlstate
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • order
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • year_month
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • read_write
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • group
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • grouping
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • groups
                                                                                                                                                                                                                                    • having
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • natural
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • high_priority
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • hour_microsecond
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • hour_minute
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • hour_second
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • ignore
                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • tinytext
                                                                                                                                                                                                                                    • index
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • tinyint
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • is
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sensitive
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • grouping
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • exit
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • current_date
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • system
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • analyze
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • binary
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sqlwarning
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • force
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • interval
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • master_bind
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • minute_second
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • primary
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • regexp
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • range
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sqlexception
                                                                                                                                                                                                                                    • infile
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • restrict
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • recursive
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • foreign
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • hour_microsecond
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • out
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • distinctrow
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • get
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • fulltext
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • table
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • current_user
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • linear
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • second_microsecond
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • change
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • utc_timestamp
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • float8
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • inner
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • inout
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • insensitive
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • insert
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • int1
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • int2
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • int3
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • int4
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • int8
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • integer
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • interval
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • into
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • io_after_gtids
                                                                                                                                                                                                                                    • io_before_gtids
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • trigger
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • float4
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • is
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • iterate
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • join
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • json_table
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • key
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • keys
                                                                                                                                                                                                                                    • kill
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • lag
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • last_value
                                                                                                                                                                                                                                    • lead
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • day_minute
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • rlike
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • rename
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • hour_minute
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • fetch
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • stored
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • exists
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • constraint
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • high_priority
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • no_write_to_binlog
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sql_calc_found_rows
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • before
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • use
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • precision
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • leading
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • leave
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • left
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • like
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • limit
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • linear
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • lines
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • load
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • localtime
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • localtimestamp
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • lock
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • longblob
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • longtext
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • loop
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • low_priority
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • master_bind
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • master_ssl_verify_server_cert
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • maxvalue
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • mediumblob
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • mediumint
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • mediumtext
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • middleint
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • minute_microsecond
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • minute_second
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • mod
                                                                                                                                                                                                                                    • modifies
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • replace
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • integer
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • lag
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • optimize
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • natural
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • no_write_to_binlog
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • not
                                                                                                                                                                                                                                    • nth_value
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • limit
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • varcharacter
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • create
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • from
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • tinyblob
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • alter
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • group
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • all
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • read
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • like
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • cascade
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • real
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • inner
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • separator
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • both
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • day_microsecond
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • condition
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • blob
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • ntile
                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • day_hour
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • option
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • longtext
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • keys
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • outfile
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • values
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • distinct
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • insert
                                                                                                                                                                                                                                    • numeric
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • resignal
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • sql
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • database
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • master_ssl_verify_server_cert
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • current_timestamp
                                                                                                                                                                                                                                    • of
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • repeat
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • first_value
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • row
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • bigint
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • terminated
                                                                                                                                                                                                                                    • on
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • optimize
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • optimizer_costs
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • option
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • optionally
                                                                                                                                                                                                                                    • or
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • cross
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • order
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • out
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • outer
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • outfile
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • over
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • partition
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • percent_rank
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • persist
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • persist_only
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • precision
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • primary
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • procedure
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • purge
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • range
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • rank
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • read
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • read_write
                                                                                                                                                                                                                                    • reads
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • groups
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • real
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • recursive
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • references
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • regexp
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • release
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • rename
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • repeat
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • replace
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • require
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • resignal
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • restrict
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • revoke
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • right
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • rlike
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • role
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • row
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • row_number
                                                                                                                                                                                                                                    • rows
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • schema
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • schemas
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • second_microsecond
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • select
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sensitive
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • separator
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • set
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • show
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • signal
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • smallint
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • spatial
                                                                                                                                                                                                                                    • specific
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • inout
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sql
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sql_big_result
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sql_calc_found_rows
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sql_small_result
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sqlexception
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sqlstate
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • sqlwarning
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • ssl
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • starting
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • stored
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • straight_join
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • system
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • table
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • terminated
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • then
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • tinyblob
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • tinyint
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • tinytext
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • to
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • trailing
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • trigger
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • undo
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • union
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • unique
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • unlock
                                                                                                                                                                                                                                    • unsigned
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • update
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • usage
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • use
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • using
                                                                                                                                                                                                                                    • utc_date
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • utc_time
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • utc_timestamp
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • values
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • varbinary
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • varchar
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • varcharacter
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • varying
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • virtual
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • when
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • where
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • window
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • write
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • xor
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • year_month
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                    • zerofill
                                                                                                                                                                                                                                    diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 25ba0b6422c4..946669ccbe51 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -5,32 +5,32 @@ sidebar_label: nim | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -41,92 +41,92 @@ sidebar_label: nim ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                    • pointer
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • bool
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • string
                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                    • float32
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                      • bool
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • char
                                                                                                                                                                                                                                      • cstring
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • float64
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • uint
                                                                                                                                                                                                                                      • float
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • float32
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • float64
                                                                                                                                                                                                                                      • int
                                                                                                                                                                                                                                      • int16
                                                                                                                                                                                                                                      • int32
                                                                                                                                                                                                                                      • int64
                                                                                                                                                                                                                                      • int8
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • char
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • uint64
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • pointer
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • uint
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • uint16
                                                                                                                                                                                                                                      • uint32
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • uint64
                                                                                                                                                                                                                                      • uint8
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • uint16
                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                      • discard
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • mod
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • converter
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • do
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • type
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • while
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • when
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • div
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • nil
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • cast
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • iterator
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • ref
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                        • addr
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • asm
                                                                                                                                                                                                                                        • bind
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • isnot
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • raise
                                                                                                                                                                                                                                        • block
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • from
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • export
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • using
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • method
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • is
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • cast
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • concept
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • converter
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • defer
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • discard
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • distinct
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • div
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                        • elif
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • end
                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • mixin
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • shl
                                                                                                                                                                                                                                        • except
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • shr
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • template
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • defer
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • concept
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • export
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • distinct
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • from
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • func
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • include
                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • out
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • tuple
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • is
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • isnot
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • iterator
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • macro
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • method
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • mixin
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • mod
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • nil
                                                                                                                                                                                                                                        • not
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • notin
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                                        • of
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • end
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • addr
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • include
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • macro
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • proc
                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • out
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • proc
                                                                                                                                                                                                                                        • ptr
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • func
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • asm
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • notin
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • raise
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • ref
                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • shl
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • shr
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • template
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • tuple
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • type
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • using
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • when
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                        diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index d37832876bb1..b0a8db1c497d 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -5,33 +5,33 @@ sidebar_label: nodejs-express-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen on.| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -46,38 +46,38 @@ sidebar_label: nodejs-express-server ## RESERVED WORDS -
                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                          • break
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • case
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • catch
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • class
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • const
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • continue
                                                                                                                                                                                                                                          • debugger
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • for
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • do
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • while
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • delete
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • switch
                                                                                                                                                                                                                                          • default
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • continue
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • delete
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • do
                                                                                                                                                                                                                                          • else
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • function
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • yield
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • let
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • catch
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • class
                                                                                                                                                                                                                                          • export
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • extends
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • finally
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • for
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • function
                                                                                                                                                                                                                                          • if
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • case
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • typeof
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • new
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • void
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • break
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • import
                                                                                                                                                                                                                                          • in
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • var
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • finally
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • this
                                                                                                                                                                                                                                          • instanceof
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • let
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • new
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • return
                                                                                                                                                                                                                                          • super
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • with
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • extends
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • switch
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • this
                                                                                                                                                                                                                                          • throw
                                                                                                                                                                                                                                          • try
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • return
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • typeof
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • var
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • void
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • while
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • with
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • yield
                                                                                                                                                                                                                                          diff --git a/docs/generators/nodejs-server-deprecated.md b/docs/generators/nodejs-server-deprecated.md index c74a32495036..0967505e6833 100644 --- a/docs/generators/nodejs-server-deprecated.md +++ b/docs/generators/nodejs-server-deprecated.md @@ -5,35 +5,35 @@ sidebar_label: nodejs-server-deprecated | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|googleCloudFunctions|When specified, it will generate the code which runs within Google Cloud Functions instead of standalone Node.JS server. See https://cloud.google.com/functions/docs/quickstart for the details of how to deploy the generated code.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |exportedName|When the generated code will be deployed to Google Cloud Functions, this option can be used to update the name of the exported function. By default, it refers to the basePath. This does not affect normal standalone nodejs server code.| |null| +|googleCloudFunctions|When specified, it will generate the code which runs within Google Cloud Functions instead of standalone Node.JS server. See https://cloud.google.com/functions/docs/quickstart for the details of how to deploy the generated code.| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen on.| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -48,38 +48,38 @@ sidebar_label: nodejs-server-deprecated ## RESERVED WORDS -
                                                                                                                                                                                                                                          • const
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • import
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                            • debugger
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • delete
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • delete
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                            • export
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • typeof
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • typeof
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                            diff --git a/docs/generators/nodejs-server.md b/docs/generators/nodejs-server.md deleted file mode 100644 index d66e4e4f0131..000000000000 --- a/docs/generators/nodejs-server.md +++ /dev/null @@ -1,16 +0,0 @@ - ---- -id: generator-opts-server-nodejs-server -title: Config Options for nodejs-server -sidebar_label: nodejs-server ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|googleCloudFunctions|When specified, it will generate the code which runs within Google Cloud Functions instead of standalone Node.JS server. See https://cloud.google.com/functions/docs/quickstart for the details of how to deploy the generated code.| |false| -|exportedName|When the generated code will be deployed to Google Cloud Functions, this option can be used to update the name of the exported function. By default, it refers to the basePath. This does not affect normal standalone nodejs server code.| |null| -|serverPort|TCP port to listen on.| |null| diff --git a/docs/generators/objc.md b/docs/generators/objc.md index b185b4614bbf..49148761b662 100644 --- a/docs/generators/objc.md +++ b/docs/generators/objc.md @@ -5,14 +5,14 @@ sidebar_label: objc | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|coreData|Should generate core data models| |false| -|classPrefix|prefix for generated classes (convention: Abbreviation of pod name e.g. `HN` for `HackerNews`).`| |OAI| -|podName|cocoapods package name (convention: CameCase).| |OpenAPIClient| -|podVersion|cocoapods package version.| |1.0.0| -|authorName|Name to use in the podspec file.| |OpenAPI| |authorEmail|Email to use in the podspec file.| |team@openapitools.org| +|authorName|Name to use in the podspec file.| |OpenAPI| +|classPrefix|prefix for generated classes (convention: Abbreviation of pod name e.g. `HN` for `HackerNews`).`| |OAI| +|coreData|Should generate core data models| |false| |gitRepoURL|URL for the git repo where this podspec should point to.| |https://github.com/openapitools/openapi-generator| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|podName|cocoapods package name (convention: CameCase).| |OpenAPIClient| +|podVersion|cocoapods package version.| |1.0.0| ## IMPORT MAPPING @@ -30,77 +30,77 @@ sidebar_label: objc ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                            • NSNumber
                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                            • NSObject
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                              • BOOL
                                                                                                                                                                                                                                              • NSData
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • bool
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • BOOL
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • NSURL
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • NSString
                                                                                                                                                                                                                                              • NSDate
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • NSNumber
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • NSObject
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • NSString
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • NSURL
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • bool
                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                              • struct
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                • _packed
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • authsettings
                                                                                                                                                                                                                                                • auto
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • _packed
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • queryparams
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • extern
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • bodyparam
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • cgfloat
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • description
                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • resourcepath
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • protocol
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • readonly
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • double
                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • unsafe_unretained
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • property
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • requestcontenttype
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • extern
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • formparams
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • headerparams
                                                                                                                                                                                                                                                • id
                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • implementation
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • localvarfiles
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • long
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • nonatomic
                                                                                                                                                                                                                                                • nsinteger
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • responsecontenttype
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • nsnumber
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • nsobject
                                                                                                                                                                                                                                                • pathparams
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • sizeof
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • double
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • authsettings
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • property
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • protocol
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • queryparams
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • readonly
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • readwrite
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • register
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • requestcontenttype
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • resourcepath
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • responsecontenttype
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • retain
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                • signed
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • nonatomic
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • formparams
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • typedef
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • headerparams
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • bodyparam
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • sizeof
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                • strong
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • nsnumber
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • retain
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • description
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • long
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • struct
                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • weak
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • localvarfiles
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • cgfloat
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • implementation
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • nsobject
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • typedef
                                                                                                                                                                                                                                                • union
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • unsafe_unretained
                                                                                                                                                                                                                                                • unsigned
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • readwrite
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • register
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • weak
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                diff --git a/docs/generators/ocaml-client.md b/docs/generators/ocaml-client.md deleted file mode 100644 index 52874232c1e8..000000000000 --- a/docs/generators/ocaml-client.md +++ /dev/null @@ -1,13 +0,0 @@ - ---- -id: generator-opts-client-ocaml-client -title: Config Options for ocaml-client -sidebar_label: ocaml-client ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index 28bae3fd5f7b..87721f59841c 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -5,31 +5,31 @@ sidebar_label: ocaml | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| +|HashMap|java.util.HashMap| |List|java.util.*| -|UUID|java.util.UUID| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -40,75 +40,75 @@ sidebar_label: ocaml ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                • bool
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • string
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • int32
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • int64
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                  • Yojson.Safe.t
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • bool
                                                                                                                                                                                                                                                  • bytes
                                                                                                                                                                                                                                                  • char
                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                  • Yojson.Safe.t
                                                                                                                                                                                                                                                  • float
                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                  • list
                                                                                                                                                                                                                                                  • int
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • int32
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • int64
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • list
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                  • exception
                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                  • struct
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                    • asr
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • mod
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • assert
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • begin
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • constraint
                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • functor
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • type
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • when
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • rec
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • done
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • downto
                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • end
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • exception
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • external
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • fun
                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • mutable
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • functor
                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • val
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • method
                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • include
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • inherit
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • initializer
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • land
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • lazy
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • lor
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • lsl
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • lsr
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • lxor
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • method
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • mod
                                                                                                                                                                                                                                                    • module
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • mutable
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                    • nonrec
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • object
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • of
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • open
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • or
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • rec
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • result
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • sig
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • struct
                                                                                                                                                                                                                                                    • then
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • done
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • external
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • to
                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • begin
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • object
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • type
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • val
                                                                                                                                                                                                                                                    • virtual
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • lsl
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • lazy
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • lsr
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • lor
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • sig
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • result
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • assert
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • of
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • land
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • end
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • lxor
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • include
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • or
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • downto
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • initializer
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • when
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • inherit
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • constraint
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • to
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • fun
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • open
                                                                                                                                                                                                                                                    diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index 19833475e791..96021a3a3e74 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -5,33 +5,33 @@ sidebar_label: openapi-yaml | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |outputFile|Output filename| |openapi/openapi.yaml| +|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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index aaa05565e8e6..95b8fd6ace01 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -5,32 +5,32 @@ sidebar_label: openapi | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES diff --git a/docs/generators/perl.md b/docs/generators/perl.md index 3bda8004d83a..3a65f291a45c 100644 --- a/docs/generators/perl.md +++ b/docs/generators/perl.md @@ -5,12 +5,12 @@ sidebar_label: perl | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|moduleName|Perl module name (convention: CamelCase or Long::Module).| |OpenAPIClient| -|moduleVersion|Perl module version.| |1.0.0| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|moduleName|Perl module name (convention: CamelCase or Long::Module).| |OpenAPIClient| +|moduleVersion|Perl module version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| ## IMPORT MAPPING @@ -26,56 +26,56 @@ sidebar_label: perl ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • ARRAY
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • string
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                      • ARRAY
                                                                                                                                                                                                                                                      • DateTime
                                                                                                                                                                                                                                                      • HASH
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • double
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • int
                                                                                                                                                                                                                                                      • object
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                      • sub
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • no
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • cmp
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • lt
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • for
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • elsif
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • do
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • while
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                        • __end__
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • __file__
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • __line__
                                                                                                                                                                                                                                                        • __package__
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • foreach
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • __end__
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • unless
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • cmp
                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • lock
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • core
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • elsif
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • eq
                                                                                                                                                                                                                                                        • exp
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • foreach
                                                                                                                                                                                                                                                        • ge
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • qq
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • qr
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • gt
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • le
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • lock
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • lt
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • m
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • ne
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • no
                                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • q
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • qq
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • qr
                                                                                                                                                                                                                                                        • qw
                                                                                                                                                                                                                                                        • qx
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • eq
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • m
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • gt
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • q
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • core
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • __line__
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                        • s
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • __file__
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • ne
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • le
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • y
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • until
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • sub
                                                                                                                                                                                                                                                        • tr
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • unless
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • until
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • y
                                                                                                                                                                                                                                                        diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index c2ed69842110..a0b7443d8719 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -5,39 +5,39 @@ sidebar_label: php-laravel | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| +|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| |srcBasePath|The directory to serve as source root.| |null| -|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -50,93 +50,93 @@ sidebar_label: php-laravel ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                        • void
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                          • DateTime
                                                                                                                                                                                                                                                          • bool
                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                          • string
                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                          • double
                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                          • byte
                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                          • mixed
                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                          • integer
                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                          • double
                                                                                                                                                                                                                                                          • float
                                                                                                                                                                                                                                                          • int
                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                          • DateTime
                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                          • integer
                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                          • mixed
                                                                                                                                                                                                                                                          • number
                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                          • object
                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                          • string
                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                          • void
                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                          • die
                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                            • __halt_compiler
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • _header_accept
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • _tempbody
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • and
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • array
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                            • callable
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • clone
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                            • declare
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • isset
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • use
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • queryparams
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • echo
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • die
                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • unset
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • empty
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • resourcepath
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • endwhile
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • echo
                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                            • elseif
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • empty
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • enddeclare
                                                                                                                                                                                                                                                            • endfor
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • require
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • require_once
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • list
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • formparams
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • headerparams
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • _header_accept
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • include_once
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • exit
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • endforeach
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • endif
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • endswitch
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • endwhile
                                                                                                                                                                                                                                                            • eval
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • exit
                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • httpbody
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • global
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • __halt_compiler
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • _tempbody
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                            • foreach
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • formparams
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • global
                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • array
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • and
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • xor
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • headerparams
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • httpbody
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                            • include
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • or
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • endswitch
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • enddeclare
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • include_once
                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • print
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                            • insteadof
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • clone
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • isset
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • list
                                                                                                                                                                                                                                                            • namespace
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • endif
                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                            • endforeach
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • or
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • print
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • queryparams
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • require
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • require_once
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • resourcepath
                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • unset
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • use
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                            • xor
                                                                                                                                                                                                                                                            diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 768a8489a880..4a33196eca3d 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -5,39 +5,39 @@ sidebar_label: php-lumen | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| +|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| |srcBasePath|The directory to serve as source root.| |null| -|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -50,93 +50,93 @@ sidebar_label: php-lumen ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                              • DateTime
                                                                                                                                                                                                                                                              • bool
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • double
                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                              • byte
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • mixed
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • integer
                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                              • double
                                                                                                                                                                                                                                                              • float
                                                                                                                                                                                                                                                              • int
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • DateTime
                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                              • integer
                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                              • mixed
                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                              • object
                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                              • void
                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                              • die
                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                • __halt_compiler
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • _header_accept
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • _tempbody
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • and
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • array
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • as
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                • callable
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • clone
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                • declare
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • isset
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • use
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • queryparams
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • echo
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • die
                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • unset
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • empty
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • resourcepath
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • endwhile
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • echo
                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                • elseif
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • empty
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • enddeclare
                                                                                                                                                                                                                                                                • endfor
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • require
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • require_once
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • list
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • formparams
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • headerparams
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • _header_accept
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • include_once
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • exit
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • as
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • endforeach
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • endif
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • endswitch
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • endwhile
                                                                                                                                                                                                                                                                • eval
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • exit
                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • httpbody
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • global
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • __halt_compiler
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • _tempbody
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                • foreach
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • formparams
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • global
                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • array
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • and
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • xor
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • headerparams
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • httpbody
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                • include
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • endswitch
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • enddeclare
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • include_once
                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • print
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                • insteadof
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • clone
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • isset
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • list
                                                                                                                                                                                                                                                                • namespace
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • endif
                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                • endforeach
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • print
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • queryparams
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • require
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • require_once
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • resourcepath
                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • unset
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • use
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                • xor
                                                                                                                                                                                                                                                                diff --git a/docs/generators/php-silex.md b/docs/generators/php-silex.md index 3057c53c8bd4..7c515f135ed3 100644 --- a/docs/generators/php-silex.md +++ b/docs/generators/php-silex.md @@ -5,32 +5,32 @@ sidebar_label: php-silex | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -43,83 +43,83 @@ sidebar_label: php-silex ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                • number
                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                  • DateTime
                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                                  • double
                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                  • mixed
                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                                                  • float
                                                                                                                                                                                                                                                                  • int
                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                  • DateTime
                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                  • mixed
                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                  • object
                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                  • die
                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                    • __halt_compiler
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • array
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                    • callable
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • clone
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                    • declare
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • isset
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • use
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • echo
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • die
                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • unset
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • empty
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • endwhile
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • echo
                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                    • elseif
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • empty
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • enddeclare
                                                                                                                                                                                                                                                                    • endfor
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • require
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • require_once
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • list
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • include_once
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • exit
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • endforeach
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • endif
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • endswitch
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • endwhile
                                                                                                                                                                                                                                                                    • eval
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • exit
                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • global
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • __halt_compiler
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                    • foreach
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • global
                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • array
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • xor
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                    • include
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • or
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • endswitch
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • enddeclare
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • include_once
                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • print
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                    • insteadof
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • clone
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • isset
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • list
                                                                                                                                                                                                                                                                    • namespace
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • endif
                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                    • endforeach
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • or
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • print
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • require
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • require_once
                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • unset
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • use
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                    • xor
                                                                                                                                                                                                                                                                    diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index 98b4234e6b68..7e6cd21fdbce 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -5,18 +5,18 @@ sidebar_label: php-slim-deprecated | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| +|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| |srcBasePath|The directory to serve as source root.| |null| -|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase| ## IMPORT MAPPING @@ -34,93 +34,93 @@ sidebar_label: php-slim-deprecated ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                      • DateTime
                                                                                                                                                                                                                                                                      • bool
                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                      • double
                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                      • byte
                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                      • mixed
                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                      • integer
                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                      • double
                                                                                                                                                                                                                                                                      • float
                                                                                                                                                                                                                                                                      • int
                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                      • DateTime
                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                      • integer
                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                      • mixed
                                                                                                                                                                                                                                                                      • number
                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                      • object
                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                      • void
                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                      • die
                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                        • __halt_compiler
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • _header_accept
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • _tempbody
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • array
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                        • callable
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • clone
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                        • declare
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • isset
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • use
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • echo
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • die
                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • unset
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • empty
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • resourcepath
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • endwhile
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • echo
                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                        • elseif
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • empty
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • enddeclare
                                                                                                                                                                                                                                                                        • endfor
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • require
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • require_once
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • list
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • formparams
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • headerparams
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • _header_accept
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • include_once
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • exit
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • endforeach
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • endif
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • endswitch
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • endwhile
                                                                                                                                                                                                                                                                        • eval
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • exit
                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • httpbody
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • global
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • __halt_compiler
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • _tempbody
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                        • foreach
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • formparams
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • global
                                                                                                                                                                                                                                                                        • goto
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • array
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • headerparams
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • httpbody
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                        • include
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • endswitch
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • enddeclare
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • include_once
                                                                                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • print
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                        • insteadof
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • clone
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • isset
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • list
                                                                                                                                                                                                                                                                        • namespace
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • endif
                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                        • endforeach
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • print
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • require
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • require_once
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • resourcepath
                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • unset
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • use
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                                                        diff --git a/docs/generators/php-slim.md b/docs/generators/php-slim.md deleted file mode 100644 index d9e188a425e1..000000000000 --- a/docs/generators/php-slim.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: Config Options for php-slim -sidebar_label: php-slim ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| -|apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase| -|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|packageName|The main package name for classes. e.g. GeneratedPetstore| |null| -|srcBasePath|The directory to serve as source root.| |null| -|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index eb3ad79302fe..1e96ca09b3a6 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -5,19 +5,19 @@ sidebar_label: php-slim4 | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| -|srcBasePath|The directory to serve as source root.| |null| -|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |psr7Implementation|Slim 4 provides its own PSR-7 implementation so that it works out of the box. However, you are free to replace Slim’s default PSR-7 objects with a third-party implementation. Ref: https://www.slimframework.com/docs/v4/concepts/value-objects.html|
                                                                                                                                                                                                                                                                        **slim-psr7**
                                                                                                                                                                                                                                                                        Slim PSR-7 Message implementation
                                                                                                                                                                                                                                                                        **nyholm-psr7**
                                                                                                                                                                                                                                                                        Nyholm PSR-7 Message implementation
                                                                                                                                                                                                                                                                        **guzzle-psr7**
                                                                                                                                                                                                                                                                        Guzzle PSR-7 Message implementation
                                                                                                                                                                                                                                                                        **zend-diactoros**
                                                                                                                                                                                                                                                                        Zend Diactoros PSR-7 Message implementation
                                                                                                                                                                                                                                                                        |slim-psr7| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|srcBasePath|The directory to serve as source root.| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |camelCase| ## IMPORT MAPPING @@ -35,93 +35,93 @@ sidebar_label: php-slim4 ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                        • void
                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                          • DateTime
                                                                                                                                                                                                                                                                          • bool
                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                          • string
                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                          • double
                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                          • byte
                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                          • mixed
                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                          • integer
                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                          • double
                                                                                                                                                                                                                                                                          • float
                                                                                                                                                                                                                                                                          • int
                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                          • DateTime
                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                          • integer
                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                          • mixed
                                                                                                                                                                                                                                                                          • number
                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                          • object
                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                          • string
                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                          • void
                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                          • die
                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                            • __halt_compiler
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • _header_accept
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • _tempbody
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • and
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • array
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                            • callable
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • clone
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                            • declare
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • isset
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • use
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • queryparams
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • echo
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • die
                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • unset
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • empty
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • resourcepath
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • endwhile
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • echo
                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                            • elseif
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • empty
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • enddeclare
                                                                                                                                                                                                                                                                            • endfor
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • require
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • require_once
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • list
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • formparams
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • headerparams
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • _header_accept
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • include_once
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • exit
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • endforeach
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • endif
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • endswitch
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • endwhile
                                                                                                                                                                                                                                                                            • eval
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • exit
                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • httpbody
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • global
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • __halt_compiler
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • _tempbody
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                            • foreach
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • formparams
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • global
                                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • array
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • and
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • xor
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • headerparams
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • httpbody
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                                            • include
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • or
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • endswitch
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • enddeclare
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • include_once
                                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • print
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                            • insteadof
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • clone
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • isset
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • list
                                                                                                                                                                                                                                                                            • namespace
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • endif
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • endforeach
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • or
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • print
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • queryparams
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • require
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • require_once
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • resourcepath
                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • unset
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • use
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                            • xor
                                                                                                                                                                                                                                                                            diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index 7a5895109099..a6fbd33e4569 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -5,24 +5,24 @@ sidebar_label: php-symfony | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| -|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| -|packageName|The main package name for classes. e.g. GeneratedPetstore| |null| -|srcBasePath|The directory to serve as source root.| |null| |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| -|composerVendorName|The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets| |null| -|bundleName|The name of the Symfony bundle. The template uses {{bundleName}}| |null| |bundleAlias|The alias of the Symfony bundle. The template uses {{aliasName}}| |null| +|bundleName|The name of the Symfony bundle. The template uses {{bundleName}}| |null| |composerProjectName|The project name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. petstore-client| |null| +|composerVendorName|The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|modelPackage|package for generated models| |null| +|packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |phpLegacySupport|Should the generated code be compatible with PHP 5.x?| |true| +|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| +|srcBasePath|The directory to serve as source root.| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| ## IMPORT MAPPING @@ -40,91 +40,91 @@ sidebar_label: php-symfony ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                            • number
                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                              • array
                                                                                                                                                                                                                                                                              • bool
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              • array
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              • double
                                                                                                                                                                                                                                                                              • byte
                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                              • mixed
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • double
                                                                                                                                                                                                                                                                              • float
                                                                                                                                                                                                                                                                              • int
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • mixed
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                                              • object
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                              • void
                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                              • die
                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                • __halt_compiler
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • _header_accept
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • _tempbody
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • and
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • array
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • as
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                • callable
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • clone
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                • declare
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • isset
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • use
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • queryparams
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • echo
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • die
                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • unset
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • empty
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • resourcepath
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • endwhile
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • echo
                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                • elseif
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • empty
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • enddeclare
                                                                                                                                                                                                                                                                                • endfor
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • require
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • require_once
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • list
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • formparams
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • headerparams
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • _header_accept
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • include_once
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • exit
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • as
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • endforeach
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • endif
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • endswitch
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • endwhile
                                                                                                                                                                                                                                                                                • eval
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • exit
                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • httpbody
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • global
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • __halt_compiler
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • _tempbody
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                • foreach
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • formparams
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • global
                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • array
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • and
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • xor
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • headerparams
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • httpbody
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                                • include
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • endswitch
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • enddeclare
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • include_once
                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • print
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                • insteadof
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • clone
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • isset
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • list
                                                                                                                                                                                                                                                                                • namespace
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • endif
                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                • endforeach
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • print
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • queryparams
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • require
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • require_once
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • resourcepath
                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • unset
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • use
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                • xor
                                                                                                                                                                                                                                                                                diff --git a/docs/generators/php-ze-ph.md b/docs/generators/php-ze-ph.md index f11bf4f5d954..99bf251414d6 100644 --- a/docs/generators/php-ze-ph.md +++ b/docs/generators/php-ze-ph.md @@ -5,39 +5,39 @@ sidebar_label: php-ze-ph | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| +|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| |srcBasePath|The directory to serve as source root.| |null| -|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -50,93 +50,93 @@ sidebar_label: php-ze-ph ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                  • DateTime
                                                                                                                                                                                                                                                                                  • bool
                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                  • double
                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                  • byte
                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                  • mixed
                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                  • double
                                                                                                                                                                                                                                                                                  • float
                                                                                                                                                                                                                                                                                  • int
                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                  • DateTime
                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                  • mixed
                                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                  • object
                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                  • void
                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                  • die
                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                    • __halt_compiler
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • _header_accept
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • _tempbody
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • array
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                    • callable
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • clone
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                    • declare
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • isset
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • use
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • queryparams
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • echo
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • die
                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • unset
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • empty
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • resourcepath
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • endwhile
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • echo
                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                    • elseif
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • empty
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • enddeclare
                                                                                                                                                                                                                                                                                    • endfor
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • require
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • require_once
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • list
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • formparams
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • headerparams
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • _header_accept
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • include_once
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • exit
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • endforeach
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • endif
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • endswitch
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • endwhile
                                                                                                                                                                                                                                                                                    • eval
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • exit
                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • httpbody
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • global
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • __halt_compiler
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • _tempbody
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                    • foreach
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • formparams
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • global
                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • array
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • and
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • xor
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • headerparams
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • httpbody
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                    • include
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • or
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • endswitch
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • enddeclare
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • include_once
                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • print
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                    • insteadof
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • clone
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • isset
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • list
                                                                                                                                                                                                                                                                                    • namespace
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • endif
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    • endforeach
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • or
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • print
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • queryparams
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • require
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • require_once
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • resourcepath
                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • unset
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • use
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                    • xor
                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/php.md b/docs/generators/php.md index 3306fbc55758..b8de32ff810e 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -5,19 +5,19 @@ sidebar_label: php | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| +|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| +|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| |srcBasePath|The directory to serve as source root.| |null| -|artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| -|hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true| +|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case| ## IMPORT MAPPING @@ -35,93 +35,93 @@ sidebar_label: php ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                      • DateTime
                                                                                                                                                                                                                                                                                      • bool
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      • double
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                      • byte
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      • mixed
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      • integer
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • double
                                                                                                                                                                                                                                                                                      • float
                                                                                                                                                                                                                                                                                      • int
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      • DateTime
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • integer
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • mixed
                                                                                                                                                                                                                                                                                      • number
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                      • object
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • void
                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                      • die
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                        • __halt_compiler
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • _header_accept
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • _tempbody
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • array
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                        • callable
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • clone
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                        • declare
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • isset
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • use
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • echo
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • die
                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • unset
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • empty
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • resourcepath
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • endwhile
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • echo
                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                        • elseif
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • empty
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • enddeclare
                                                                                                                                                                                                                                                                                        • endfor
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • require
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • require_once
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • list
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • formparams
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • headerparams
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • _header_accept
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • include_once
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • exit
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • endforeach
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • endif
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • endswitch
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • endwhile
                                                                                                                                                                                                                                                                                        • eval
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • exit
                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • httpbody
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • global
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • __halt_compiler
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • _tempbody
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                        • foreach
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • formparams
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • global
                                                                                                                                                                                                                                                                                        • goto
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • array
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • headerparams
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • httpbody
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                                        • include
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • endswitch
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • enddeclare
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • include_once
                                                                                                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • print
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                        • insteadof
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • clone
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • isset
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • list
                                                                                                                                                                                                                                                                                        • namespace
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • endif
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • endforeach
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • print
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • require
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • require_once
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • resourcepath
                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • unset
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • use
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                        • xor
                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index f4d5daaf73b1..e8fcfaf8af32 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -5,30 +5,30 @@ sidebar_label: powershell | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|Client package name (e.g. org.openapitools.client).| |Org.OpenAPITools| -|packageGuid|GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.| |null| |csharpClientPath|Path to the C# API client generated by OpenAPI Generator, e.g. $ScriptDir\..\csharp\OpenAPIClient where $ScriptDir is the current directory. NOTE: you will need to generate the C# API client separately.| |$ScriptDir\csharp\OpenAPIClient| +|packageGuid|GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.| |null| +|packageName|Client package name (e.g. org.openapitools.client).| |Org.OpenAPITools| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -39,62 +39,62 @@ sidebar_label: powershell ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                        • System.DateTime
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • SByte
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • XmlDocument
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Byte
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Byte[]
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Char
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Decimal
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                          • Guid
                                                                                                                                                                                                                                                                                          • Int16
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Uri
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • TimeSpan
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Decimal
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Byte[]
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Int32
                                                                                                                                                                                                                                                                                          • Int64
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • ProgressRecord
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • SByte
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • SecureString
                                                                                                                                                                                                                                                                                          • Single
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Version
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Int32
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Char
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Byte
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • System.DateTime
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • TimeSpan
                                                                                                                                                                                                                                                                                          • UInt16
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • ProgressRecord
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • UInt64
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                          • UInt32
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • SecureString
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • UInt64
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Uri
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • Version
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                          • XmlDocument
                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                          • In
                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                          • Catch
                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                            • Begin
                                                                                                                                                                                                                                                                                            • Break
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Process
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Catch
                                                                                                                                                                                                                                                                                            • Continue
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Elseif
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Function
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Dynamicparam
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Throw
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Begin
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Try
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Private
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Exit
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Until
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Return
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • For
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Local
                                                                                                                                                                                                                                                                                            • Data
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Trap
                                                                                                                                                                                                                                                                                            • Do
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • From
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • While
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Switch
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Filter
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Dynamicparam
                                                                                                                                                                                                                                                                                            • Else
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Param
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Foreach
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Elseif
                                                                                                                                                                                                                                                                                            • End
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Exit
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Filter
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Finally
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • For
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Foreach
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • From
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Function
                                                                                                                                                                                                                                                                                            • If
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • In
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Local
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Param
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Private
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Process
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Return
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Switch
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Throw
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Trap
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Try
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • Until
                                                                                                                                                                                                                                                                                            • Where
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • Finally
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                            • While
                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/protobuf-schema.md b/docs/generators/protobuf-schema.md index e12611217f6d..71b97282c3bf 100644 --- a/docs/generators/protobuf-schema.md +++ b/docs/generators/protobuf-schema.md @@ -21,23 +21,23 @@ sidebar_label: protobuf-schema ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                            • fixed64
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • fixed32
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • sint64
                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                            • sint32
                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                              • array
                                                                                                                                                                                                                                                                                              • bool
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • sfixed64
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • bytes
                                                                                                                                                                                                                                                                                              • double
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • fixed32
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • fixed64
                                                                                                                                                                                                                                                                                              • float
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • array
                                                                                                                                                                                                                                                                                              • int32
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • bytes
                                                                                                                                                                                                                                                                                              • int64
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • uint64
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • map
                                                                                                                                                                                                                                                                                              • sfixed32
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • sfixed64
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • sint32
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • sint64
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                                              • uint32
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • map
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                              • uint64
                                                                                                                                                                                                                                                                                              ## RESERVED WORDS diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index c6c59087e71b..3fa24defa317 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -5,39 +5,39 @@ sidebar_label: python-aiohttp | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|packageName|python package name (convention: snake_case).| |openapi_server| -|packageVersion|python package version.| |1.0.0| |controllerPackage|controller package| |controllers| |defaultController|default controller| |default_controller| -|supportPython2|support python2| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|packageName|python package name (convention: snake_case).| |openapi_server| +|packageVersion|python package version.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen to in app.run| |8080| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|supportPython2|support python2| |false| |useNose|use the nose test framework| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -48,57 +48,57 @@ sidebar_label: python-aiohttp ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                              • str
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • date
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • datetime
                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                              • file
                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                • Dict
                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                • List
                                                                                                                                                                                                                                                                                                • bool
                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                • Dict
                                                                                                                                                                                                                                                                                                • byte
                                                                                                                                                                                                                                                                                                • bytearray
                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                • List
                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                • date
                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                • datetime
                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                • file
                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                • object
                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                • str
                                                                                                                                                                                                                                                                                                ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                  • and
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • as
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • assert
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • break
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • class
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • continue
                                                                                                                                                                                                                                                                                                  • def
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • for
                                                                                                                                                                                                                                                                                                  • del
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • elif
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • else
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • except
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • exec
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • false
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • finally
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • for
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • from
                                                                                                                                                                                                                                                                                                  • global
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • if
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • import
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • in
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • is
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • lambda
                                                                                                                                                                                                                                                                                                  • none
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                                                                                                  • nonlocal
                                                                                                                                                                                                                                                                                                  • not
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • lambda
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • and
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • assert
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • else
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • continue
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • yield
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • property
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • raise
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • from
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • if
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • class
                                                                                                                                                                                                                                                                                                  • or
                                                                                                                                                                                                                                                                                                  • pass
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • break
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • in
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • finally
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • false
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • is
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • elif
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • with
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • as
                                                                                                                                                                                                                                                                                                  • print
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • true
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • property
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • raise
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • return
                                                                                                                                                                                                                                                                                                  • self
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • except
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • true
                                                                                                                                                                                                                                                                                                  • try
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • exec
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • return
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • with
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                  • yield
                                                                                                                                                                                                                                                                                                  diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index cb290b83ed5d..6acfe0910078 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -5,39 +5,39 @@ sidebar_label: python-blueplanet | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|packageName|python package name (convention: snake_case).| |openapi_server| -|packageVersion|python package version.| |1.0.0| |controllerPackage|controller package| |controllers| |defaultController|default controller| |default_controller| -|supportPython2|support python2| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|packageName|python package name (convention: snake_case).| |openapi_server| +|packageVersion|python package version.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen to in app.run| |8080| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|supportPython2|support python2| |false| |useNose|use the nose test framework| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -48,57 +48,57 @@ sidebar_label: python-blueplanet ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                  • str
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • date
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • datetime
                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                  • file
                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                    • Dict
                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                    • List
                                                                                                                                                                                                                                                                                                    • bool
                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                    • Dict
                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                    • bytearray
                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                    • List
                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                    • date
                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                    • datetime
                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                    • file
                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                    • object
                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                    • str
                                                                                                                                                                                                                                                                                                    ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                      • and
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • as
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • assert
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • break
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • class
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • continue
                                                                                                                                                                                                                                                                                                      • def
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • for
                                                                                                                                                                                                                                                                                                      • del
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • elif
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • else
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • except
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • exec
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • false
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • finally
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • for
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • from
                                                                                                                                                                                                                                                                                                      • global
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • if
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • import
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • in
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • is
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • lambda
                                                                                                                                                                                                                                                                                                      • none
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • while
                                                                                                                                                                                                                                                                                                      • nonlocal
                                                                                                                                                                                                                                                                                                      • not
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • lambda
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • and
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • assert
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • else
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • continue
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • yield
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • property
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • raise
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • from
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • if
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • class
                                                                                                                                                                                                                                                                                                      • or
                                                                                                                                                                                                                                                                                                      • pass
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • break
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • in
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • finally
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • false
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • is
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • elif
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • with
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • as
                                                                                                                                                                                                                                                                                                      • print
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • true
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • property
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • raise
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • return
                                                                                                                                                                                                                                                                                                      • self
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • except
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • true
                                                                                                                                                                                                                                                                                                      • try
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • exec
                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                      • return
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • while
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • with
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                      • yield
                                                                                                                                                                                                                                                                                                      diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index a45c61e6167c..1c42e7691979 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -5,15 +5,15 @@ sidebar_label: python-experimental | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| |packageName|python package name (convention: snake_case).| |openapi_client| -|projectName|python project name in setup.py (e.g. petstore-api).| |null| -|packageVersion|python package version.| |1.0.0| |packageUrl|python package URL.| |null| +|packageVersion|python package version.| |1.0.0| +|projectName|python project name in setup.py (e.g. petstore-api).| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| |useNose|use the nose test framework| |false| -|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| ## IMPORT MAPPING @@ -30,68 +30,68 @@ sidebar_label: python-experimental ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                      • str
                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                        • bool
                                                                                                                                                                                                                                                                                                        • date
                                                                                                                                                                                                                                                                                                        • datetime
                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                        • dict
                                                                                                                                                                                                                                                                                                        • file
                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                        • none_type
                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                        • bool
                                                                                                                                                                                                                                                                                                        • file_type
                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                        • dict
                                                                                                                                                                                                                                                                                                        • float
                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                        • list
                                                                                                                                                                                                                                                                                                        • int
                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                        • list
                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                        • none_type
                                                                                                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                        • str
                                                                                                                                                                                                                                                                                                        ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                          • all_params
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • and
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • as
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • assert
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • async
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • auth_settings
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • await
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • body_params
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • break
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • class
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • continue
                                                                                                                                                                                                                                                                                                          • def
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • del
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • elif
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • else
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • except
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • exec
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • false
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • finally
                                                                                                                                                                                                                                                                                                          • for
                                                                                                                                                                                                                                                                                                          • form_params
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • local_var_files
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • del
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • from
                                                                                                                                                                                                                                                                                                          • global
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • header_params
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • if
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • import
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • in
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • is
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • lambda
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • local_var_files
                                                                                                                                                                                                                                                                                                          • none
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • while
                                                                                                                                                                                                                                                                                                          • nonlocal
                                                                                                                                                                                                                                                                                                          • not
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • lambda
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • and
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • assert
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • else
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • continue
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • resource_path
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • yield
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • property
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • raise
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • await
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • path_params
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • from
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • if
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • class
                                                                                                                                                                                                                                                                                                          • or
                                                                                                                                                                                                                                                                                                          • pass
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • break
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • in
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • finally
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • all_params
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • false
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • body_params
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • is
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • elif
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • auth_settings
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • header_params
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • with
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • async
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • as
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • path_params
                                                                                                                                                                                                                                                                                                          • print
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • property
                                                                                                                                                                                                                                                                                                          • query_params
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • true
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • raise
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • resource_path
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • return
                                                                                                                                                                                                                                                                                                          • self
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • except
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • true
                                                                                                                                                                                                                                                                                                          • try
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • exec
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • return
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • while
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • with
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                          • yield
                                                                                                                                                                                                                                                                                                          diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index c09d7d993ab1..1f76e4346687 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -5,39 +5,39 @@ sidebar_label: python-flask | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|packageName|python package name (convention: snake_case).| |openapi_server| -|packageVersion|python package version.| |1.0.0| |controllerPackage|controller package| |controllers| |defaultController|default controller| |default_controller| -|supportPython2|support python2| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|packageName|python package name (convention: snake_case).| |openapi_server| +|packageVersion|python package version.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen to in app.run| |8080| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|supportPython2|support python2| |false| |useNose|use the nose test framework| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -48,57 +48,57 @@ sidebar_label: python-flask ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                          • str
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • date
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • datetime
                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                          • file
                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                            • Dict
                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                            • List
                                                                                                                                                                                                                                                                                                            • bool
                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                            • Dict
                                                                                                                                                                                                                                                                                                            • byte
                                                                                                                                                                                                                                                                                                            • bytearray
                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                            • List
                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                            • date
                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                            • datetime
                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                            • file
                                                                                                                                                                                                                                                                                                            • float
                                                                                                                                                                                                                                                                                                            • int
                                                                                                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                            • str
                                                                                                                                                                                                                                                                                                            ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                              • and
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • as
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • assert
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • break
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • class
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • continue
                                                                                                                                                                                                                                                                                                              • def
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • for
                                                                                                                                                                                                                                                                                                              • del
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • elif
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • else
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • except
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • exec
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • false
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • finally
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • for
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • from
                                                                                                                                                                                                                                                                                                              • global
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • if
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • import
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • in
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • is
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • lambda
                                                                                                                                                                                                                                                                                                              • none
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • while
                                                                                                                                                                                                                                                                                                              • nonlocal
                                                                                                                                                                                                                                                                                                              • not
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • lambda
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • and
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • assert
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • else
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • continue
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • yield
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • property
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • raise
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • from
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • if
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • class
                                                                                                                                                                                                                                                                                                              • or
                                                                                                                                                                                                                                                                                                              • pass
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • break
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • in
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • finally
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • false
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • is
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • elif
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • with
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • as
                                                                                                                                                                                                                                                                                                              • print
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • true
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • property
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • raise
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • return
                                                                                                                                                                                                                                                                                                              • self
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • except
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • true
                                                                                                                                                                                                                                                                                                              • try
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • exec
                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                              • return
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • while
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • with
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                              • yield
                                                                                                                                                                                                                                                                                                              diff --git a/docs/generators/python.md b/docs/generators/python.md index 2a394af036af..19e268b90dd0 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -5,15 +5,15 @@ sidebar_label: python | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| |packageName|python package name (convention: snake_case).| |openapi_client| -|projectName|python project name in setup.py (e.g. petstore-api).| |null| -|packageVersion|python package version.| |1.0.0| |packageUrl|python package URL.| |null| +|packageVersion|python package version.| |1.0.0| +|projectName|python project name in setup.py (e.g. petstore-api).| |null| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| |useNose|use the nose test framework| |false| -|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| ## IMPORT MAPPING @@ -29,66 +29,66 @@ sidebar_label: python ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                              • str
                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                • bool
                                                                                                                                                                                                                                                                                                                • date
                                                                                                                                                                                                                                                                                                                • datetime
                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                • file
                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                • bool
                                                                                                                                                                                                                                                                                                                • dict
                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                • file
                                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                • list
                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                • list
                                                                                                                                                                                                                                                                                                                • object
                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                • str
                                                                                                                                                                                                                                                                                                                ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                  • all_params
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • and
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • as
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • assert
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • async
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • auth_settings
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • await
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • body_params
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • break
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • class
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • continue
                                                                                                                                                                                                                                                                                                                  • def
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • del
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • elif
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • else
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • except
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • exec
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • false
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • finally
                                                                                                                                                                                                                                                                                                                  • for
                                                                                                                                                                                                                                                                                                                  • form_params
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • local_var_files
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • del
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • from
                                                                                                                                                                                                                                                                                                                  • global
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • header_params
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • if
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • import
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • in
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • is
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • lambda
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • local_var_files
                                                                                                                                                                                                                                                                                                                  • none
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                                                                                                                  • nonlocal
                                                                                                                                                                                                                                                                                                                  • not
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • lambda
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • and
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • assert
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • else
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • continue
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • resource_path
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • yield
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • property
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • raise
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • await
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • path_params
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • from
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • if
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • class
                                                                                                                                                                                                                                                                                                                  • or
                                                                                                                                                                                                                                                                                                                  • pass
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • break
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • in
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • finally
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • all_params
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • false
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • body_params
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • is
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • elif
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • auth_settings
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • header_params
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • with
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • async
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • as
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • path_params
                                                                                                                                                                                                                                                                                                                  • print
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • property
                                                                                                                                                                                                                                                                                                                  • query_params
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • true
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • raise
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • resource_path
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • return
                                                                                                                                                                                                                                                                                                                  • self
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • except
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • true
                                                                                                                                                                                                                                                                                                                  • try
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • exec
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • return
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • with
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • yield
                                                                                                                                                                                                                                                                                                                  diff --git a/docs/generators/r.md b/docs/generators/r.md index e304948fdca8..8d71a39a69e1 100644 --- a/docs/generators/r.md +++ b/docs/generators/r.md @@ -5,11 +5,11 @@ sidebar_label: r | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | +|exceptionPackage|Specify the exception handling package|
                                                                                                                                                                                                                                                                                                                  **default**
                                                                                                                                                                                                                                                                                                                  Use stop() for raising exceptions.
                                                                                                                                                                                                                                                                                                                  **rlang**
                                                                                                                                                                                                                                                                                                                  Use rlang package for exceptions.
                                                                                                                                                                                                                                                                                                                  |default| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |packageName|R package name (convention: lowercase).| |openapi| |packageVersion|R package version.| |1.0.0| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |returnExceptionOnFailure|Throw an exception on non success response codes| |false| -|exceptionPackage|Specify the exception handling package|
                                                                                                                                                                                                                                                                                                                  **default**
                                                                                                                                                                                                                                                                                                                  Use stop() for raising exceptions.
                                                                                                                                                                                                                                                                                                                  **rlang**
                                                                                                                                                                                                                                                                                                                  Use rlang package for exceptions.
                                                                                                                                                                                                                                                                                                                  |default| ## IMPORT MAPPING @@ -26,32 +26,32 @@ sidebar_label: r ## LANGUAGE PRIMITIVES
                                                                                                                                                                                                                                                                                                                  • character
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • numeric
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                                                                                                  • data.frame
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • integer
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                  • numeric
                                                                                                                                                                                                                                                                                                                  • object
                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                  • next
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • inf
                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                  • in
                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                    • apiresponse
                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • apiresponse
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • inf
                                                                                                                                                                                                                                                                                                                    • na
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                    • na_character_
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • na_complex_
                                                                                                                                                                                                                                                                                                                    • na_integer_
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • na_real_
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • nan
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • next
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                    • repeat
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • na_complex_
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • nan
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • na_real_
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/ruby-on-rails.md b/docs/generators/ruby-on-rails.md index 07e9f93fb22f..82d9f33bb343 100644 --- a/docs/generators/ruby-on-rails.md +++ b/docs/generators/ruby-on-rails.md @@ -11,22 +11,22 @@ sidebar_label: ruby-on-rails | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -37,56 +37,56 @@ sidebar_label: ruby-on-rails ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                    • Integer
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • Array
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • Float
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • Object
                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                    • String
                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                      • Array
                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                      • Hash
                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                      • Date
                                                                                                                                                                                                                                                                                                                      • DateTime
                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                      • Float
                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                      • Hash
                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                      • Integer
                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                      • next
                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                      • defined?
                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                        • __file__
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • __line__
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • alias
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • begin
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                        • def
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • redo
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • defined?
                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • elsif
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • when
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • nil
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • not
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • unless
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • and
                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • alias
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • elsif
                                                                                                                                                                                                                                                                                                                        • end
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • rescue
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • retry
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                                                                                                        • ensure
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                        • module
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • undef
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • then
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • next
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • nil
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • not
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • or
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • redo
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • rescue
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • retry
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • self
                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • __line__
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • __file__
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • then
                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • self
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • undef
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • unless
                                                                                                                                                                                                                                                                                                                        • until
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • begin
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • when
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/ruby-sinatra.md b/docs/generators/ruby-sinatra.md index 6d6af85c58f6..b759489632c0 100644 --- a/docs/generators/ruby-sinatra.md +++ b/docs/generators/ruby-sinatra.md @@ -10,22 +10,22 @@ sidebar_label: ruby-sinatra | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -36,56 +36,56 @@ sidebar_label: ruby-sinatra ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                        • Integer
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • Array
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • Float
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • Object
                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                          • Array
                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                          • Hash
                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                          • File
                                                                                                                                                                                                                                                                                                                          • Date
                                                                                                                                                                                                                                                                                                                          • DateTime
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • File
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • Hash
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • Integer
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                          • next
                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                          • defined?
                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                            • __file__
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • __line__
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • alias
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • and
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • begin
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                            • def
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • redo
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • defined?
                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • elsif
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • when
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • nil
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • not
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • unless
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • and
                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • alias
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • elsif
                                                                                                                                                                                                                                                                                                                            • end
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • rescue
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • retry
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • or
                                                                                                                                                                                                                                                                                                                            • ensure
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                            • module
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • undef
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • then
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • next
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • nil
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • not
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • or
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • redo
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • rescue
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • retry
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • self
                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • __line__
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • __file__
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • then
                                                                                                                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • self
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • undef
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • unless
                                                                                                                                                                                                                                                                                                                            • until
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • begin
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • when
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 15d27a0fd1f1..f749fa96677a 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -5,23 +5,23 @@ sidebar_label: ruby | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|gemName|gem name (convention: underscore_case).| |openapi_client| -|moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient| -|gemVersion|gem version.| |1.0.0| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|gemAuthor|gem author (only one is supported).| |null| +|gemAuthorEmail|gem author email (only one is supported).| |null| +|gemDescription|gem description. | |This gem maps to a REST API| +|gemHomepage|gem homepage. | |http://org.openapitools| |gemLicense|gem license. | |unlicense| +|gemName|gem name (convention: underscore_case).| |openapi_client| |gemRequiredRubyVersion|gem required Ruby version. | |>= 1.9| -|gemHomepage|gem homepage. | |http://org.openapitools| |gemSummary|gem summary. | |A ruby wrapper for the REST APIs| -|gemDescription|gem description. | |This gem maps to a REST API| -|gemAuthor|gem author (only one is supported).| |null| -|gemAuthorEmail|gem author email (only one is supported).| |null| +|gemVersion|gem version.| |1.0.0| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |library|HTTP library template (sub-template) to use|
                                                                                                                                                                                                                                                                                                                            **faraday**
                                                                                                                                                                                                                                                                                                                            Faraday (https://github.com/lostisland/faraday) (Beta support)
                                                                                                                                                                                                                                                                                                                            **typhoeus**
                                                                                                                                                                                                                                                                                                                            Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)
                                                                                                                                                                                                                                                                                                                            |typhoeus| +|moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient| +|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| ## IMPORT MAPPING @@ -37,70 +37,70 @@ sidebar_label: ruby ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                            • string
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • String
                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                            • Hash
                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                              • Date
                                                                                                                                                                                                                                                                                                                              • DateTime
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • int
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                              • Float
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • array
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • Hash
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • array
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • int
                                                                                                                                                                                                                                                                                                                              • map
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                              • next
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • defined?
                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                              • def
                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                • __file__
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • __line__
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • _header_accept
                                                                                                                                                                                                                                                                                                                                • _header_accept_result
                                                                                                                                                                                                                                                                                                                                • _header_content_type
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • local_var_path
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • form_params
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • redo
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • elsif
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • when
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • nil
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • not
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • unless
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • alias
                                                                                                                                                                                                                                                                                                                                • and
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • auth_names
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • begin
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • def
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • defined?
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • alias
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • elsif
                                                                                                                                                                                                                                                                                                                                • end
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • rescue
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • retry
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                                                                                                                • ensure
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • module
                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • undef
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • then
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • _header_accept
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • form_params
                                                                                                                                                                                                                                                                                                                                • header_params
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • __line__
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • auth_names
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • __file__
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • local_var_path
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • module
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • next
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • nil
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • not
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • or
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • post_body
                                                                                                                                                                                                                                                                                                                                • query_params
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • redo
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • rescue
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • retry
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                • self
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • until
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • post_body
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • begin
                                                                                                                                                                                                                                                                                                                                • send
                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • then
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • undef
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • unless
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • until
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • when
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                diff --git a/docs/generators/rust-server.md b/docs/generators/rust-server.md index c17eb0390fa0..50551fa841cc 100644 --- a/docs/generators/rust-server.md +++ b/docs/generators/rust-server.md @@ -24,75 +24,75 @@ sidebar_label: rust-server ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                • u8
                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                  • bool
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • char
                                                                                                                                                                                                                                                                                                                                  • f32
                                                                                                                                                                                                                                                                                                                                  • f64
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • i64
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • i16
                                                                                                                                                                                                                                                                                                                                  • i32
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • i64
                                                                                                                                                                                                                                                                                                                                  • i8
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • i16
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • usize
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • str
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • u64
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • u32
                                                                                                                                                                                                                                                                                                                                  • isize
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • char
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • str
                                                                                                                                                                                                                                                                                                                                  • u16
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • u32
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • u64
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • u8
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                  • usize
                                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                  • struct
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • mod
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • use
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • extern
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • do
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • type
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • impl
                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                  • ref
                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • alignof
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • become
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • box
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • crate
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • loop
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • priv
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • sizeof
                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • extern
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • become
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • virtual
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                    • fn
                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • box
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • pure
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • unsafe
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • impl
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • loop
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • macro
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • mod
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • move
                                                                                                                                                                                                                                                                                                                                    • mut
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                    • offsetof
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • where
                                                                                                                                                                                                                                                                                                                                    • override
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • typeof
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • macro
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • move
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • priv
                                                                                                                                                                                                                                                                                                                                    • proc
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • alignof
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • crate
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • self
                                                                                                                                                                                                                                                                                                                                    • pub
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • pure
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • ref
                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • self
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • sizeof
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • struct
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • type
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • typeof
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • unsafe
                                                                                                                                                                                                                                                                                                                                    • unsized
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • use
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • virtual
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • where
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/rust.md b/docs/generators/rust.md index 42c924301a5b..9dfff407df99 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -5,31 +5,31 @@ sidebar_label: rust | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|Rust package name (convention: lowercase).| |openapi| -|packageVersion|Rust package version.| |1.0.0| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |library|library template (sub-template) to use.|
                                                                                                                                                                                                                                                                                                                                    **hyper**
                                                                                                                                                                                                                                                                                                                                    HTTP client: Hyper.
                                                                                                                                                                                                                                                                                                                                    **reqwest**
                                                                                                                                                                                                                                                                                                                                    HTTP client: Reqwest.
                                                                                                                                                                                                                                                                                                                                    |hyper| +|packageName|Rust package name (convention: lowercase).| |openapi| +|packageVersion|Rust package version.| |1.0.0| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -40,74 +40,74 @@ sidebar_label: rust ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                    • u8
                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                    • f32
                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • Vec<u8>
                                                                                                                                                                                                                                                                                                                                      • bool
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • char
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • f32
                                                                                                                                                                                                                                                                                                                                      • f64
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • i64
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • i16
                                                                                                                                                                                                                                                                                                                                      • i32
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • i64
                                                                                                                                                                                                                                                                                                                                      • i8
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • i16
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • u64
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • Vec<u8>
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • u32
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • char
                                                                                                                                                                                                                                                                                                                                      • u16
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • u32
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • u64
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                      • u8
                                                                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                      • struct
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • mod
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • use
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • extern
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • do
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • type
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • while
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • impl
                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                      • ref
                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • alignof
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • become
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • box
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • crate
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • loop
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • priv
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • sizeof
                                                                                                                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • extern
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • become
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • virtual
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                                                                        • fn
                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • box
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • pure
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • unsafe
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • impl
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • loop
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • macro
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • match
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • mod
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • move
                                                                                                                                                                                                                                                                                                                                        • mut
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                        • offsetof
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • where
                                                                                                                                                                                                                                                                                                                                        • override
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • typeof
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • macro
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • move
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • priv
                                                                                                                                                                                                                                                                                                                                        • proc
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • alignof
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • match
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • crate
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • self
                                                                                                                                                                                                                                                                                                                                        • pub
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • pure
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • ref
                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • self
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • sizeof
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • struct
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • type
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • typeof
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • unsafe
                                                                                                                                                                                                                                                                                                                                        • unsized
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • use
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • virtual
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • where
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index e24f0977b4bb..3ad7d16a08dc 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -5,102 +5,102 @@ sidebar_label: scala-akka | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|sourceFolder|source folder for generated code| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client| +|modelPackage|package for generated models| |null| +|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 | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| -|ListBuffer|scala.collection.mutable.ListBuffer| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.DateTime| -|Array|java.util.List| +|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| -|File|java.io.File| ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|set|Set| |array|ListBuffer| |map|Map| +|set|Set| ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • Double
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • Any
                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                        • Int
                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                          • Any
                                                                                                                                                                                                                                                                                                                                          • Array
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                          • Long
                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                          • Int
                                                                                                                                                                                                                                                                                                                                          • List
                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                          • Long
                                                                                                                                                                                                                                                                                                                                          • Map
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                          • Seq
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                          • implicit
                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                          • private
                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                            • def
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • lazy
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • type
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • override
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                            • forsome
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • val
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • implicit
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • lazy
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • match
                                                                                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • override
                                                                                                                                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                            • sealed
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • match
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • type
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • val
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/scala-finch.md b/docs/generators/scala-finch.md index 7a286005eb38..764ea5fd718a 100644 --- a/docs/generators/scala-finch.md +++ b/docs/generators/scala-finch.md @@ -5,29 +5,29 @@ sidebar_label: scala-finch | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|packageName|Finch package name (e.g. org.openapitools).| |org.openapitools| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| +|modelPackage|package for generated models| |null| +|packageName|Finch package name (e.g. org.openapitools).| |org.openapitools| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|java.time.LocalDateTime| -|LocalTime|java.time.LocalTime| -|HashMap|scala.collection.immutable.HashMap| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|java.time.LocalDate| +|ArrayBuffer|scala.collection.mutable.ArrayBuffer| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|java.time.LocalDateTime| -|ZonedDateTime|java.time.ZonedDateTime| -|ArrayBuffer|scala.collection.mutable.ArrayBuffer| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|scala.collection.immutable.HashMap| +|LocalDate|java.time.LocalDate| +|LocalDateTime|java.time.LocalDateTime| +|LocalTime|java.time.LocalTime| |Map|scala.collection.immutable.Map| |Seq|scala.collection.immutable.Seq| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| +|ZonedDateTime|java.time.ZonedDateTime| ## INSTANTIATION TYPES @@ -40,85 +40,85 @@ sidebar_label: scala-finch ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                            • Integer
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • Float
                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                            • AnyVal
                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                              • Any
                                                                                                                                                                                                                                                                                                                                              • AnyRef
                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                              • Long
                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                              • AnyVal
                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                              • Double
                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                              • Any
                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                              • Float
                                                                                                                                                                                                                                                                                                                                              • Int
                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                              • Long
                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                              • synchronized
                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • assert
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • byte
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                • def
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • type
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • forsome
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • val
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • sealed
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                • double
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • byte
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • strictfp
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • throws
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • transient
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • object
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • forsome
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                                                                                                • implicit
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • lazy
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • lazy
                                                                                                                                                                                                                                                                                                                                                • long
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • match
                                                                                                                                                                                                                                                                                                                                                • native
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • assert
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • object
                                                                                                                                                                                                                                                                                                                                                • override
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • match
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • sealed
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • strictfp
                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • synchronized
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • throws
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • transient
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • type
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • val
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 810d1887c46b..33542992272d 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -5,112 +5,112 @@ sidebar_label: scala-gatling | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|modelPackage|package for generated models| |null| +|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 | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| -|ListBuffer|scala.collection.mutable.ListBuffer| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|ListSet|scala.collection.immutable.ListSet| -|UUID|java.util.UUID| |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.*| |Seq|scala.collection.immutable.Seq| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|set|Set| |array|ListBuffer| |map|HashMap| +|set|Set| ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                • String
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • Double
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • Any
                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                • Int
                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                  • Any
                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                  • Double
                                                                                                                                                                                                                                                                                                                                                  • Float
                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                  • Long
                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                  • Int
                                                                                                                                                                                                                                                                                                                                                  • List
                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                  • Long
                                                                                                                                                                                                                                                                                                                                                  • Map
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                  • Seq
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                  • def
                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • apiinvoker
                                                                                                                                                                                                                                                                                                                                                    • basepath
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • queryparams
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • type
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • path
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • forsome
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • contenttype
                                                                                                                                                                                                                                                                                                                                                    • contenttypes
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • val
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • mp
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • sealed
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • def
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                    • formparams
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • forsome
                                                                                                                                                                                                                                                                                                                                                    • headerparams
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • object
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                    • implicit
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                    • lazy
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • apiinvoker
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • mp
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • object
                                                                                                                                                                                                                                                                                                                                                    • override
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • path
                                                                                                                                                                                                                                                                                                                                                    • postbody
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • match
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • contenttype
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • queryparams
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • sealed
                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • trait
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • type
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • val
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index f9ff403756c5..4fa157bcd7ae 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -5,113 +5,113 @@ sidebar_label: scala-httpclient-deprecated | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|sourceFolder|source folder for generated code| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|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 | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| -|ListBuffer|scala.collection.mutable.ListBuffer| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|ListSet|scala.collection.immutable.ListSet| -|UUID|java.util.UUID| |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.*| |Seq|scala.collection.immutable.Seq| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|set|Set| |array|ListBuffer| |map|HashMap| +|set|Set| ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                    • String
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • Double
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • Any
                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                    • Int
                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                      • Any
                                                                                                                                                                                                                                                                                                                                                      • Array
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                      • Double
                                                                                                                                                                                                                                                                                                                                                      • Float
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      • Long
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                      • Int
                                                                                                                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                      • Long
                                                                                                                                                                                                                                                                                                                                                      • Map
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                      • Seq
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                      • def
                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • apiinvoker
                                                                                                                                                                                                                                                                                                                                                        • basepath
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • type
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • path
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • forsome
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • contenttype
                                                                                                                                                                                                                                                                                                                                                        • contenttypes
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • val
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • mp
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • sealed
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • def
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                        • formparams
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • forsome
                                                                                                                                                                                                                                                                                                                                                        • headerparams
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                        • implicit
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                        • lazy
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • apiinvoker
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • match
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • mp
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                                                                                                                                                        • override
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • path
                                                                                                                                                                                                                                                                                                                                                        • postbody
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • match
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • contenttype
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • sealed
                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • with
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • type
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • val
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • with
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/scala-httpclient.md b/docs/generators/scala-httpclient.md deleted file mode 100644 index 6b85507bc29d..000000000000 --- a/docs/generators/scala-httpclient.md +++ /dev/null @@ -1,17 +0,0 @@ - ---- -id: generator-opts-client-scala-httpclient -title: Config Options for scala-httpclient -sidebar_label: scala-httpclient ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| -|apiPackage|package for generated api classes| |null| -|sourceFolder|source folder for generated code| |null| -|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index 92ad208d8b7a..0608d6cfa2d5 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -5,113 +5,113 @@ sidebar_label: scala-lagom-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|sourceFolder|source folder for generated code| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|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 | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| -|ListBuffer|scala.collection.mutable.ListBuffer| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.DateTime| -|Array|java.util.List| -|ListSet|scala.collection.immutable.ListSet| -|UUID|java.util.UUID| |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.*| |Seq|scala.collection.immutable.Seq| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|set|Set| |array|ListBuffer| |map|HashMap| +|set|Set| ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • Double
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • Any
                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                        • Int
                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                          • Any
                                                                                                                                                                                                                                                                                                                                                          • Array
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                          • Long
                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                          • Int
                                                                                                                                                                                                                                                                                                                                                          • List
                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                          • Long
                                                                                                                                                                                                                                                                                                                                                          • Map
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                                          • Seq
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                          • def
                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • apiinvoker
                                                                                                                                                                                                                                                                                                                                                            • basepath
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • queryparams
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • type
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • path
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • forsome
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • contenttype
                                                                                                                                                                                                                                                                                                                                                            • contenttypes
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • val
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • mp
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • sealed
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • def
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                            • formparams
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • forsome
                                                                                                                                                                                                                                                                                                                                                            • headerparams
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                            • implicit
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                            • lazy
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • apiinvoker
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • match
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • mp
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                                                                                                                                                            • override
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • path
                                                                                                                                                                                                                                                                                                                                                            • postbody
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • match
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • contenttype
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • queryparams
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • sealed
                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • trait
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • type
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • val
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/scala-play-framework.md b/docs/generators/scala-play-framework.md deleted file mode 100644 index ff1f8243e176..000000000000 --- a/docs/generators/scala-play-framework.md +++ /dev/null @@ -1,22 +0,0 @@ - ---- -id: generator-opts-server-scala-play-framework -title: Config Options for scala-play-framework -sidebar_label: scala-play-framework ---- - -| Option | Description | Values | Default | -| ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| -|apiPackage|package for generated api classes| |null| -|sourceFolder|source folder for generated code| |null| -|routesFileName|Name of the routes file to generate.| |routes| -|routesFileName|Base package in which supporting classes are generated.| |org.openapitools| -|skipStubs|If set, skips generation of stub classes.| |false| -|supportAsync|If set, wraps API return types with Futures and generates async actions.| |false| -|generateCustomExceptions|If set, generates custom exception types.| |true| -|useSwaggerUI|Add a route to /api which show your documentation in swagger-ui. Will also import needed dependencies| |true| diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index af6e5a41c8e9..48d5cc9d55ac 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -5,112 +5,112 @@ sidebar_label: scala-play-server | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|sourceFolder|source folder for generated code| |null| -|routesFileName|Name of the routes file to generate.| |routes| |basePackage|Base package in which supporting classes are generated.| |org.openapitools| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|generateCustomExceptions|If set, generates custom exception types.| |true| +|modelPackage|package for generated models| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|routesFileName|Name of the routes file to generate.| |routes| |skipStubs|If set, skips generation of stub classes.| |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| |supportAsync|If set, wraps API return types with Futures and generates async actions.| |false| -|generateCustomExceptions|If set, generates custom exception types.| |true| |useSwaggerUI|Add a route to /api which show your documentation in swagger-ui. Will also import needed dependencies| |true| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|scala.collection.immutable.Set| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| -|ListBuffer|scala.collection.mutable.ListBuffer| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|java.time.LocalDate| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| +|File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|ListBuffer|scala.collection.mutable.ListBuffer| |ListSet|scala.collection.immutable.ListSet| +|LocalDate|java.time.LocalDate| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Map|java.util.Map| |OffsetDateTime|java.time.OffsetDateTime| -|List|java.util.*| +|Seq|scala.collection.immutable.Seq| +|Set|scala.collection.immutable.Set| |TemporaryFile|play.api.libs.Files.TemporaryFile| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| |UUID|java.util.UUID| -|File|java.io.File| -|Map|java.util.Map| -|Seq|scala.collection.immutable.Seq| ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|set|Set| |array|List| |map|Map| +|set|Set| ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                            • String
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • Double
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • Any
                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                            • Int
                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                              • Any
                                                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Double
                                                                                                                                                                                                                                                                                                                                                              • Float
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                              • Long
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Int
                                                                                                                                                                                                                                                                                                                                                              • List
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Long
                                                                                                                                                                                                                                                                                                                                                              • Map
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                              • Seq
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                              • implicit
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                              • private
                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                • def
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • lazy
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • type
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • forSome
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • override
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • forSome
                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • val
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • implicit
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • lazy
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • match
                                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • object
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • override
                                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                • sealed
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • match
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • trait
                                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • object
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • type
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • val
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index aeb1f8de82c6..f420e0519960 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -5,114 +5,114 @@ sidebar_label: scalatra | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|modelPackage|package for generated models| |null| +|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 | | ---------- | ------- | -|LocalDateTime|org.joda.time.LocalDateTime| -|Set|scala.collection.immutable.Set| -|LocalTime|org.joda.time.LocalTime| -|HashMap|java.util.HashMap| -|ListBuffer|scala.collection.mutable.ListBuffer| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.DateTime| -|Array|java.util.List| -|ListSet|scala.collection.immutable.ListSet| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|ListBuffer|scala.collection.mutable.ListBuffer| +|ListSet|scala.collection.immutable.ListSet| +|LocalDate|org.joda.time.LocalDate| +|LocalDateTime|org.joda.time.LocalDateTime| +|LocalTime|org.joda.time.LocalTime| |Map|java.util.Map| +|Set|scala.collection.immutable.Set| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|set|Set| |map|HashMap| +|set|Set| ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                • String
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • Double
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • Any
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                • Int
                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                  • Any
                                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                  • Double
                                                                                                                                                                                                                                                                                                                                                                  • Float
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • Long
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                  • Int
                                                                                                                                                                                                                                                                                                                                                                  • List
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                  • Long
                                                                                                                                                                                                                                                                                                                                                                  • Map
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                  • Seq
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                  • synchronized
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • do
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • float
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • type
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • protected
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • continue
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • else
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • catch
                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                  • if
                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • assert
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • strictfp
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • throws
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • transient
                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                    • native
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • assert
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • volatile
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • strictfp
                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • synchronized
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • throws
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • transient
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • type
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • volatile
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 082e71e57144..e6050ab3f19a 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -5,113 +5,113 @@ sidebar_label: scalaz | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |null| |apiPackage|package for generated api classes| |null| -|sourceFolder|source folder for generated code| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|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 | | ---------- | ------- | -|LocalDateTime|org.joda.time.LocalDateTime| -|LocalTime|org.joda.time.LocalTime| -|HashMap|java.util.HashMap| -|ListBuffer|scala.collection.mutable.ListBuffer| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.LocalDate| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.DateTime| -|Array|java.util.List| -|ListSet|scala.collection.immutable.ListSet| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|ListBuffer|scala.collection.mutable.ListBuffer| +|ListSet|scala.collection.immutable.ListSet| +|LocalDate|org.joda.time.LocalDate| +|LocalDateTime|org.joda.time.LocalDateTime| +|LocalTime|org.joda.time.LocalTime| |Seq|scala.collection.immutable.Seq| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES | Type/Alias | Instantiated By | | ---------- | --------------- | -|set|Set| |array|ListBuffer| |map|HashMap| +|set|Set| ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                    • String
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • Double
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • Any
                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                    • Int
                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                      • Any
                                                                                                                                                                                                                                                                                                                                                                      • Array
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • Double
                                                                                                                                                                                                                                                                                                                                                                      • Float
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      • Long
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • Int
                                                                                                                                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • Long
                                                                                                                                                                                                                                                                                                                                                                      • Map
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                                      • Seq
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                      • def
                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • apiinvoker
                                                                                                                                                                                                                                                                                                                                                                        • basepath
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • type
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • path
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • forsome
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • contenttype
                                                                                                                                                                                                                                                                                                                                                                        • contenttypes
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • val
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • mp
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • sealed
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • def
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                        • formparams
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • forsome
                                                                                                                                                                                                                                                                                                                                                                        • headerparams
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                                        • implicit
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                                        • lazy
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • apiinvoker
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • match
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • mp
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • object
                                                                                                                                                                                                                                                                                                                                                                        • override
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • path
                                                                                                                                                                                                                                                                                                                                                                        • postbody
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • match
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • contenttype
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • queryparams
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • sealed
                                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • with
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • trait
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • type
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • val
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • with
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 09a9e979cdf7..7ba4dca43d0d 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -5,86 +5,86 @@ sidebar_label: spring | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|modelPackage|package for generated models| |org.openapitools.model| +|apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false| |apiPackage|package for generated api classes| |org.openapitools.api| -|invokerPackage|root package for generated code| |org.openapitools.api| -|groupId|groupId in generated pom.xml| |org.openapitools| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| |artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-spring| -|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| |artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| -|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| -|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| -|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|async|use async Callable controllers| |false| +|basePackage|base package (invokerPackage) for generated code| |org.openapitools| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|configPackage|configuration package for generated code| |org.openapitools.configuration| +|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                                                                                                                                                                                        **joda**
                                                                                                                                                                                                                                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                                                                                                                                                                                                                                        **legacy**
                                                                                                                                                                                                                                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                                                                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                                                                                                                                                                                        **java8**
                                                                                                                                                                                                                                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                                                                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                                                                                                                                                                                        |threetenbp| +|delegatePattern|Whether to generate the server files using the delegate pattern| |false| |developerEmail|developer email in generated pom.xml| |team@openapitools.org| +|developerName|developer name in generated pom.xml| |OpenAPI-Generator Contributors| |developerOrganization|developer organization in generated pom.xml| |OpenAPITools.org| |developerOrganizationUrl|developer organization URL in generated pom.xml| |http://openapitools.org| -|licenseName|The name of the license| |Unlicense| -|licenseUrl|The URL of the license| |http://unlicense.org| -|sourceFolder|source folder for generated code| |src/main/java| -|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| -|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| +|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| -|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| -|dateLibrary|Option. Date library to use|
                                                                                                                                                                                                                                                                                                                                                                        **joda**
                                                                                                                                                                                                                                                                                                                                                                        Joda (for legacy app only)
                                                                                                                                                                                                                                                                                                                                                                        **legacy**
                                                                                                                                                                                                                                                                                                                                                                        Legacy java.util.Date (if you really have a good reason not to use threetenbp
                                                                                                                                                                                                                                                                                                                                                                        **java8-localdatetime**
                                                                                                                                                                                                                                                                                                                                                                        Java 8 using LocalDateTime (for legacy app only)
                                                                                                                                                                                                                                                                                                                                                                        **java8**
                                                                                                                                                                                                                                                                                                                                                                        Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets "java8" to true
                                                                                                                                                                                                                                                                                                                                                                        **threetenbp**
                                                                                                                                                                                                                                                                                                                                                                        Backport of JSR310 (preferred for jdk < 1.8)
                                                                                                                                                                                                                                                                                                                                                                        |threetenbp| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| +|invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
                                                                                                                                                                                                                                                                                                                                                                        **true**
                                                                                                                                                                                                                                                                                                                                                                        Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used
                                                                                                                                                                                                                                                                                                                                                                        **false**
                                                                                                                                                                                                                                                                                                                                                                        Various third party libraries as needed
                                                                                                                                                                                                                                                                                                                                                                        |false| -|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false| -|booleanGetterPrefix|Set booleanGetterPrefix| |get| -|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations)| |null| -|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|library|library template (sub-template)|
                                                                                                                                                                                                                                                                                                                                                                        **spring-boot**
                                                                                                                                                                                                                                                                                                                                                                        Spring-boot Server application using the SpringFox integration.
                                                                                                                                                                                                                                                                                                                                                                        **spring-mvc**
                                                                                                                                                                                                                                                                                                                                                                        Spring-MVC Server application using the SpringFox integration.
                                                                                                                                                                                                                                                                                                                                                                        **spring-cloud**
                                                                                                                                                                                                                                                                                                                                                                        Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
                                                                                                                                                                                                                                                                                                                                                                        |spring-boot| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.model| |parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| +|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| |parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null| -|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                                                                                                                                                                                                        **true**
                                                                                                                                                                                                                                                                                                                                                                        Use a SnapShot Version
                                                                                                                                                                                                                                                                                                                                                                        **false**
                                                                                                                                                                                                                                                                                                                                                                        Use a Release Version
                                                                                                                                                                                                                                                                                                                                                                        |null| -|title|server title name or client service name| |OpenAPI Spring| -|configPackage|configuration package for generated code| |org.openapitools.configuration| -|basePackage|base package (invokerPackage) for generated code| |org.openapitools| -|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| -|delegatePattern|Whether to generate the server files using the delegate pattern| |false| -|singleContentTypes|Whether to select only one produces/consumes content-type by operation.| |false| -|skipDefaultInterface|Whether to generate default implementations for java8 interfaces| |false| -|async|use async Callable controllers| |false| +|performBeanValidation|Use Bean Validation Impl. to perform BeanValidation| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reactive|wrap responses in Mono/Flux Reactor types (spring-boot only)| |false| |responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, HystrixCommand, RxObservable, RxSingle or fully qualified type)| |null| -|virtualService|Generates the virtual service. For more details refer - https://github.com/elan-venture/virtualan/wiki| |false| -|useTags|use tags for creating interface and controller classnames| |false| -|useBeanValidation|Use BeanValidation API annotations| |true| -|performBeanValidation|Use Bean Validation Impl. to perform BeanValidation| |false| -|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| -|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false| -|apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false| -|useOptional|Use Optional container for optional parameters| |false| -|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| |returnSuccessCode|Generated server returns 2xx code| |false| +|scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| +|scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|singleContentTypes|Whether to select only one produces/consumes content-type by operation.| |false| +|skipDefaultInterface|Whether to generate default implementations for java8 interfaces| |false| +|snapshotVersion|Uses a SNAPSHOT version.|
                                                                                                                                                                                                                                                                                                                                                                        **true**
                                                                                                                                                                                                                                                                                                                                                                        Use a SnapShot Version
                                                                                                                                                                                                                                                                                                                                                                        **false**
                                                                                                                                                                                                                                                                                                                                                                        Use a Release Version
                                                                                                                                                                                                                                                                                                                                                                        |null| +|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| |src/main/java| +|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false| +|title|server title name or client service name| |OpenAPI Spring| |unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false| -|library|library template (sub-template)|
                                                                                                                                                                                                                                                                                                                                                                        **spring-boot**
                                                                                                                                                                                                                                                                                                                                                                        Spring-boot Server application using the SpringFox integration.
                                                                                                                                                                                                                                                                                                                                                                        **spring-mvc**
                                                                                                                                                                                                                                                                                                                                                                        Spring-MVC Server application using the SpringFox integration.
                                                                                                                                                                                                                                                                                                                                                                        **spring-cloud**
                                                                                                                                                                                                                                                                                                                                                                        Spring-Cloud-Feign client with Spring-Boot auto-configured settings.
                                                                                                                                                                                                                                                                                                                                                                        |spring-boot| +|useBeanValidation|Use BeanValidation API annotations| |true| +|useOptional|Use Optional container for optional parameters| |false| +|useTags|use tags for creating interface and controller classnames| |false| +|virtualService|Generates the virtual service. For more details refer - https://github.com/elan-venture/virtualan/wiki| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| ## IMPORT MAPPING | Type/Alias | Imports | | ---------- | ------- | -|LocalDateTime|org.joda.time.*| -|Set|java.util.*| -|LocalTime|org.joda.time.*| -|HashMap|java.util.HashMap| +|Array|java.util.List| |ArrayList|java.util.ArrayList| -|URI|java.net.URI| -|Timestamp|java.sql.Timestamp| -|LocalDate|org.joda.time.*| |BigDecimal|java.math.BigDecimal| |Date|java.util.Date| |DateTime|org.joda.time.*| -|Array|java.util.List| -|List|java.util.*| -|UUID|java.util.UUID| |File|java.io.File| +|HashMap|java.util.HashMap| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| |Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| ## INSTANTIATION TYPES @@ -97,87 +97,87 @@ sidebar_label: spring ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                        • Integer
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        • byte[]
                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                          • Integer
                                                                                                                                                                                                                                                                                                                                                                          • Long
                                                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                          • byte[]
                                                                                                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                          • localvaraccepts
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • synchronized
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • do
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • float
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • while
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • localvarpath
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • protected
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • continue
                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                          • else
                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                                            • apiclient
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • localvarqueryparams
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • apiexception
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • apiresponse
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • assert
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • byte
                                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • localvaraccept
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • char
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • configuration
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                                                                            • double
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • byte
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • strictfp
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • throws
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                                                            • enum
                                                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • transient
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • apiexception
                                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • float
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • configuration
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • apiresponse
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • int
                                                                                                                                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • long
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • localvarheaderparams
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • native
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • localvarcontenttype
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • assert
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • stringutil
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localreturntype
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvaraccept
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvaraccepts
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvarauthnames
                                                                                                                                                                                                                                                                                                                                                                            • localvarcollectionqueryparams
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvarcontenttype
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvarcontenttypes
                                                                                                                                                                                                                                                                                                                                                                            • localvarcookieparams
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • localreturntype
                                                                                                                                                                                                                                                                                                                                                                            • localvarformparams
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • volatile
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • localvarauthnames
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • int
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvarheaderparams
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvarpath
                                                                                                                                                                                                                                                                                                                                                                            • localvarpostbody
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • char
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • short
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • localvarqueryparams
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • long
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • native
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • object
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • short
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • strictfp
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • stringutil
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • synchronized
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • throws
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • transient
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • volatile
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/swift2-deprecated.md b/docs/generators/swift2-deprecated.md index 45a054768602..776a950d6979 100644 --- a/docs/generators/swift2-deprecated.md +++ b/docs/generators/swift2-deprecated.md @@ -5,27 +5,27 @@ sidebar_label: swift2-deprecated | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|projectName|Project name in Xcode| |null| -|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift are available.| |null| -|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| -|podSource|Source information used for Podspec| |null| -|podVersion|Version used for Podspec| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |podAuthors|Authors used for Podspec| |null| -|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podDescription|Description used for Podspec| |null| |podDocsetURL|Docset URL used for Podspec| |null| -|podLicense|License used for Podspec| |null| +|podDocumentationURL|Documentation URL used for Podspec| |null| |podHomepage|Homepage used for Podspec| |null| -|podSummary|Summary used for Podspec| |null| -|podDescription|Description used for Podspec| |null| +|podLicense|License used for Podspec| |null| |podScreenshots|Screenshots used for Podspec| |null| -|podDocumentationURL|Documentation URL used for Podspec| |null| +|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podSource|Source information used for Podspec| |null| +|podSummary|Summary used for Podspec| |null| +|podVersion|Version used for Podspec| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|projectName|Project name in Xcode| |null| +|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift are available.| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| ## IMPORT MAPPING @@ -41,114 +41,114 @@ sidebar_label: swift2-deprecated ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                            • Float
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • AnyObject
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • Character
                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                            • Int64
                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                              • AnyObject
                                                                                                                                                                                                                                                                                                                                                                              • Bool
                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                              • Character
                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                              • Double
                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                              • Float
                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                              • Int
                                                                                                                                                                                                                                                                                                                                                                              • Int32
                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                              • Int64
                                                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                                                              • Void
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • Double
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • Int
                                                                                                                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                              • struct
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • prefix
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • convenience
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • none
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • required
                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                              • nil
                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                • Any
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                • Bool
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • mutating
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • init
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • is
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • optional
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • infix
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Character
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Class
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Data
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Double
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • FILE
                                                                                                                                                                                                                                                                                                                                                                                • FUNCTION
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                                                                                                                                                • Float
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • as
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • left
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • extension
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • internal
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • lazy
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • guard
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Self
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • weak
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Int
                                                                                                                                                                                                                                                                                                                                                                                • Int32
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • get
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • where
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • override
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • typealias
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • FILE
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Int64
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • LINE
                                                                                                                                                                                                                                                                                                                                                                                • Protocol
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • set
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • willSet
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • right
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Self
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • String
                                                                                                                                                                                                                                                                                                                                                                                • Type
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • Void
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • as
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • associativity
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • convenience
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • defer
                                                                                                                                                                                                                                                                                                                                                                                • deinit
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • self
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • open
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • didSet
                                                                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • dynamic
                                                                                                                                                                                                                                                                                                                                                                                • dynamicType
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • extension
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • fallthrough
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • fileprivate
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • func
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • get
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • guard
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • indirect
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • infix
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • init
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • inout
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • internal
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • is
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • lazy
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • left
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • mutating
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • nil
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • none
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • open
                                                                                                                                                                                                                                                                                                                                                                                • operator
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • optional
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • override
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • postfix
                                                                                                                                                                                                                                                                                                                                                                                • precedence
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • prefix
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                • protocol
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • dynamic
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Void
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • associativity
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • repeat
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • required
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • rethrows
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • right
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • self
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • set
                                                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Character
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • struct
                                                                                                                                                                                                                                                                                                                                                                                • subscript
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • indirect
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                                                • throws
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Double
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • fileprivate
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Class
                                                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • rethrows
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • defer
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Any
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Int
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • LINE
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • repeat
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • postfix
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Data
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • typealias
                                                                                                                                                                                                                                                                                                                                                                                • unowned
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • inout
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • func
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • Int64
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • didSet
                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                • fallthrough
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • weak
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • where
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                • willSet
                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/generators/swift3-deprecated.md b/docs/generators/swift3-deprecated.md index a3079fd60794..d605fb9d7674 100644 --- a/docs/generators/swift3-deprecated.md +++ b/docs/generators/swift3-deprecated.md @@ -5,29 +5,29 @@ sidebar_label: swift3-deprecated | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|projectName|Project name in Xcode| |null| -|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift are available.| |null| -|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| |objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null| -|podSource|Source information used for Podspec| |null| -|podVersion|Version used for Podspec| |null| |podAuthors|Authors used for Podspec| |null| -|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podDescription|Description used for Podspec| |null| |podDocsetURL|Docset URL used for Podspec| |null| -|podLicense|License used for Podspec| |null| +|podDocumentationURL|Documentation URL used for Podspec| |null| |podHomepage|Homepage used for Podspec| |null| -|podSummary|Summary used for Podspec| |null| -|podDescription|Description used for Podspec| |null| +|podLicense|License used for Podspec| |null| |podScreenshots|Screenshots used for Podspec| |null| -|podDocumentationURL|Documentation URL used for Podspec| |null| +|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podSource|Source information used for Podspec| |null| +|podSummary|Summary used for Podspec| |null| +|podVersion|Version used for Podspec| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|projectName|Project name in Xcode| |null| +|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift are available.| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| +|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| ## IMPORT MAPPING @@ -43,106 +43,106 @@ sidebar_label: swift3-deprecated ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                • Float
                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                  • Any
                                                                                                                                                                                                                                                                                                                                                                                  • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • Character
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • Int64
                                                                                                                                                                                                                                                                                                                                                                                  • Bool
                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                  • Character
                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                  • Double
                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                  • Float
                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                  • Int
                                                                                                                                                                                                                                                                                                                                                                                  • Int32
                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                  • Int64
                                                                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                                                                  • Void
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • Double
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • Any
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • Int
                                                                                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                  • struct
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • prefix
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • convenience
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • do
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • none
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • dynamicType
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • while
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • operator
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • precedence
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • required
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • nil
                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                  • protocol
                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                    • Any
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                    • Bool
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • dynamic
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • mutating
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • Void
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • associativity
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • init
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                    • Character
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • subscript
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • is
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • optional
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • infix
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • Class
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • Data
                                                                                                                                                                                                                                                                                                                                                                                    • Double
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • Error
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • FILE
                                                                                                                                                                                                                                                                                                                                                                                    • FUNCTION
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                    • Float
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • left
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • Class
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • extension
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • internal
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • lazy
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • Self
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • Any
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                    • Int
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • URL
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • weak
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                    • Int32
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • get
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • Int64
                                                                                                                                                                                                                                                                                                                                                                                    • LINE
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • where
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • override
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • postfix
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • typealias
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • FILE
                                                                                                                                                                                                                                                                                                                                                                                    • Protocol
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • set
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • Error
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • Data
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • right
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • unowned
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                    • Response
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • inout
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • Self
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • String
                                                                                                                                                                                                                                                                                                                                                                                    • Type
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • URL
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • Void
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • as
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • associativity
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • convenience
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                    • deinit
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • func
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • Int64
                                                                                                                                                                                                                                                                                                                                                                                    • didSet
                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                    • self
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • dynamic
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • dynamicType
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • extension
                                                                                                                                                                                                                                                                                                                                                                                    • fallthrough
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • func
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • get
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • infix
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • init
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • inout
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • internal
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • is
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • lazy
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • left
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • mutating
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • nil
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • none
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • operator
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • optional
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • override
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • postfix
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • precedence
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • prefix
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • protocol
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • required
                                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • right
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • self
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • set
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • struct
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • subscript
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • typealias
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • unowned
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • weak
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • where
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/swift4.md b/docs/generators/swift4.md index 7018d2aad258..dfd34277fcc6 100644 --- a/docs/generators/swift4.md +++ b/docs/generators/swift4.md @@ -5,31 +5,30 @@ sidebar_label: swift4 | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|projectName|Project name in Xcode| |null| -|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result are available.| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| -|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| |objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null| -|podSource|Source information used for Podspec| |null| -|podVersion|Version used for Podspec| |null| |podAuthors|Authors used for Podspec| |null| -|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podDescription|Description used for Podspec| |null| |podDocsetURL|Docset URL used for Podspec| |null| -|podLicense|License used for Podspec| |null| +|podDocumentationURL|Documentation URL used for Podspec| |null| |podHomepage|Homepage used for Podspec| |null| -|podSummary|Summary used for Podspec| |null| -|podDescription|Description used for Podspec| |null| +|podLicense|License used for Podspec| |null| |podScreenshots|Screenshots used for Podspec| |null| -|podDocumentationURL|Documentation URL used for Podspec| |null| +|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podSource|Source information used for Podspec| |null| +|podSummary|Summary used for Podspec| |null| +|podVersion|Version used for Podspec| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|projectName|Project name in Xcode| |null| +|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result are available.| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| +|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| ## IMPORT MAPPING @@ -45,163 +44,163 @@ sidebar_label: swift4 ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                    • Character
                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                      • Any
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • Bool
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • Character
                                                                                                                                                                                                                                                                                                                                                                                      • Data
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • Double
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • Any
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • Int
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • URL
                                                                                                                                                                                                                                                                                                                                                                                      • Date
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • Float
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                      • Decimal
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • Int64
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • Bool
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • Double
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • Float
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • Int
                                                                                                                                                                                                                                                                                                                                                                                      • Int32
                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                      • Void
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • Int64
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • URL
                                                                                                                                                                                                                                                                                                                                                                                      • UUID
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                      • Void
                                                                                                                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                      • struct
                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                        • #available
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #colorLiteral
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #column
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #else
                                                                                                                                                                                                                                                                                                                                                                                        • #elseif
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #endif
                                                                                                                                                                                                                                                                                                                                                                                        • #file
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #fileLiteral
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #function
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #if
                                                                                                                                                                                                                                                                                                                                                                                        • #imageLiteral
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • prefix
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • convenience
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • none
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Int16
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • required
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • nil
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • CountableRange
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Float32
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #line
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #selector
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • #sourceLocation
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Any
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Array
                                                                                                                                                                                                                                                                                                                                                                                        • Bool
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • mutating
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • init
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • is
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • optional
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • infix
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Character
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Class
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • ClosedRange
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Codable
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • CountableClosedRange
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • CountableRange
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Data
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Decodable
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Dictionary
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Double
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Encodable
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Error
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • FILE
                                                                                                                                                                                                                                                                                                                                                                                        • FUNCTION
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                                                                                                                                                                        • Float
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Decodable
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • left
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • extension
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • internal
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Set
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • lazy
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • guard
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • associatedtype
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #available
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Self
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • URL
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • weak
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #function
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Float32
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Float64
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Float80
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Int
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Int16
                                                                                                                                                                                                                                                                                                                                                                                        • Int32
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • get
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • where
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • typealias
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • override
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Protocol
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • FILE
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • _
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #selector
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • set
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • willSet
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • right
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Int64
                                                                                                                                                                                                                                                                                                                                                                                        • Int8
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • LINE
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • OptionSet
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Optional
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Protocol
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Range
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Response
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Self
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Set
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • StaticString
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                                                                                                                        • Type
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Float64
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • deinit
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • self
                                                                                                                                                                                                                                                                                                                                                                                        • UInt
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • UInt16
                                                                                                                                                                                                                                                                                                                                                                                        • UInt32
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • open
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #if
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #column
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #line
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #endif
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • UInt64
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • UInt8
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • URL
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Unicode
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • Void
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • _
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • as
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • associatedtype
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • associativity
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • convenience
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • defer
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • deinit
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • didSet
                                                                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • dynamic
                                                                                                                                                                                                                                                                                                                                                                                        • dynamicType
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • extension
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • fallthrough
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • fileprivate
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • func
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • get
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • guard
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • indirect
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • infix
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • init
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • inout
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • internal
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • is
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • lazy
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • left
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • mutating
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • nil
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • none
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • open
                                                                                                                                                                                                                                                                                                                                                                                        • operator
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • optional
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • override
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • postfix
                                                                                                                                                                                                                                                                                                                                                                                        • precedence
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • StaticString
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • prefix
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                                        • protocol
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • CountableClosedRange
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • dynamic
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • associativity
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Void
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Unicode
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • repeat
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • required
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • rethrows
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • right
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • self
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • set
                                                                                                                                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #colorLiteral
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • struct
                                                                                                                                                                                                                                                                                                                                                                                        • subscript
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • indirect
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Optional
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Character
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                                                        • throws
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Range
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Double
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • fileprivate
                                                                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Class
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • UInt16
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • rethrows
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Float80
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Encodable
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #else
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Dictionary
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • defer
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • ClosedRange
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #fileLiteral
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Any
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Int
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • UInt8
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • repeat
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • LINE
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • #sourceLocation
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • postfix
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • UInt64
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Codable
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Error
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Data
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • typealias
                                                                                                                                                                                                                                                                                                                                                                                        • unowned
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Response
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Array
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • inout
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • func
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • Int64
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • didSet
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • fallthrough
                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                        • OptionSet
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • weak
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • where
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                        • willSet
                                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 3897f396d290..b5295c907585 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -5,30 +5,29 @@ sidebar_label: swift5 | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| -|projectName|Project name in Xcode| |null| -|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result, Combine are available.| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| +|library|Library template (sub-template) to use|
                                                                                                                                                                                                                                                                                                                                                                                        **urlsession**
                                                                                                                                                                                                                                                                                                                                                                                        [DEFAULT] HTTP client: URLSession
                                                                                                                                                                                                                                                                                                                                                                                        **alamofire**
                                                                                                                                                                                                                                                                                                                                                                                        HTTP client: Alamofire
                                                                                                                                                                                                                                                                                                                                                                                        |urlsession| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null| -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null| |objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null| -|podSource|Source information used for Podspec| |null| -|podVersion|Version used for Podspec| |null| |podAuthors|Authors used for Podspec| |null| -|podSocialMediaURL|Social Media URL used for Podspec| |null| -|podLicense|License used for Podspec| |null| -|podHomepage|Homepage used for Podspec| |null| -|podSummary|Summary used for Podspec| |null| |podDescription|Description used for Podspec| |null| -|podScreenshots|Screenshots used for Podspec| |null| |podDocumentationURL|Documentation URL used for Podspec| |null| +|podHomepage|Homepage used for Podspec| |null| +|podLicense|License used for Podspec| |null| +|podScreenshots|Screenshots used for Podspec| |null| +|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podSource|Source information used for Podspec| |null| +|podSummary|Summary used for Podspec| |null| +|podVersion|Version used for Podspec| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|projectName|Project name in Xcode| |null| +|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result, Combine are available.| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null| -|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| -|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| -|library|Library template (sub-template) to use|
                                                                                                                                                                                                                                                                                                                                                                                        **urlsession**
                                                                                                                                                                                                                                                                                                                                                                                        [DEFAULT] HTTP client: URLSession
                                                                                                                                                                                                                                                                                                                                                                                        **alamofire**
                                                                                                                                                                                                                                                                                                                                                                                        HTTP client: Alamofire
                                                                                                                                                                                                                                                                                                                                                                                        |urlsession| ## IMPORT MAPPING @@ -44,163 +43,163 @@ sidebar_label: swift5 ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                        • Character
                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                          • Any
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • Bool
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • Character
                                                                                                                                                                                                                                                                                                                                                                                          • Data
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • Any
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • Int
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • URL
                                                                                                                                                                                                                                                                                                                                                                                          • Date
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                          • Decimal
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • Int64
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • Bool
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • Int
                                                                                                                                                                                                                                                                                                                                                                                          • Int32
                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                          • Void
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • Int64
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • URL
                                                                                                                                                                                                                                                                                                                                                                                          • UUID
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                          • Void
                                                                                                                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                          • struct
                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                            • #available
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #colorLiteral
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #column
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #else
                                                                                                                                                                                                                                                                                                                                                                                            • #elseif
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #endif
                                                                                                                                                                                                                                                                                                                                                                                            • #file
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #fileLiteral
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #function
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #if
                                                                                                                                                                                                                                                                                                                                                                                            • #imageLiteral
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • prefix
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • convenience
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • none
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • String
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Int16
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • required
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • nil
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • CountableRange
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Float32
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #line
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #selector
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • #sourceLocation
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Any
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Array
                                                                                                                                                                                                                                                                                                                                                                                            • Bool
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • mutating
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • init
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • is
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • optional
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • infix
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Character
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Class
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • ClosedRange
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Codable
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • CountableClosedRange
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • CountableRange
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Data
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Decodable
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Dictionary
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Double
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Encodable
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Error
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • FILE
                                                                                                                                                                                                                                                                                                                                                                                            • FUNCTION
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • enum
                                                                                                                                                                                                                                                                                                                                                                                            • Float
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Decodable
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • left
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • extension
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • internal
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Set
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • lazy
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • guard
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • associatedtype
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #available
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Self
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • URL
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • weak
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #function
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Float32
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Float64
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Float80
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Int
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Int16
                                                                                                                                                                                                                                                                                                                                                                                            • Int32
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • get
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • where
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • typealias
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • override
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Protocol
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • FILE
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • _
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #selector
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • set
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • willSet
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • right
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Int64
                                                                                                                                                                                                                                                                                                                                                                                            • Int8
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • ErrorResponse
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • LINE
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • OptionSet
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Optional
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Protocol
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Range
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Response
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Self
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Set
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • StaticString
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • String
                                                                                                                                                                                                                                                                                                                                                                                            • Type
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • AnyObject
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Float64
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • deinit
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • self
                                                                                                                                                                                                                                                                                                                                                                                            • UInt
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • UInt16
                                                                                                                                                                                                                                                                                                                                                                                            • UInt32
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • open
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #if
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #column
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • COLUMN
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #line
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #endif
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • UInt64
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • UInt8
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • URL
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Unicode
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • Void
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • _
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • as
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • associatedtype
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • associativity
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • convenience
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • defer
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • deinit
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • didSet
                                                                                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • dynamic
                                                                                                                                                                                                                                                                                                                                                                                            • dynamicType
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • enum
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • extension
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • fallthrough
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • fileprivate
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • func
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • get
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • guard
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • indirect
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • infix
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • init
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • inout
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • internal
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • is
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • lazy
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • left
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • mutating
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • nil
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • none
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • nonmutating
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • open
                                                                                                                                                                                                                                                                                                                                                                                            • operator
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • optional
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • override
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • postfix
                                                                                                                                                                                                                                                                                                                                                                                            • precedence
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • StaticString
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • prefix
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                                            • protocol
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • CountableClosedRange
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • dynamic
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • associativity
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Void
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Unicode
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • repeat
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • required
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • rethrows
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • right
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • self
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • set
                                                                                                                                                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #colorLiteral
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • struct
                                                                                                                                                                                                                                                                                                                                                                                            • subscript
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • indirect
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Optional
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Character
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                                            • throws
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Range
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Double
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • fileprivate
                                                                                                                                                                                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Class
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • UInt16
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • rethrows
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Float80
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Encodable
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #else
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Dictionary
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • defer
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • ClosedRange
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #fileLiteral
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Any
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Int
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • UInt8
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • repeat
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • LINE
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • #sourceLocation
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • postfix
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • UInt64
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Codable
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Error
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Data
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • typealias
                                                                                                                                                                                                                                                                                                                                                                                            • unowned
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Response
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Array
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • inout
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • func
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Int64
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • didSet
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • fallthrough
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • OptionSet
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • weak
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • where
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                            • willSet
                                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 30cebe68a211..cb9160d26ace 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -5,29 +5,29 @@ sidebar_label: typescript-angular | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|apiModulePrefix|The prefix of the generated ApiModule.| |null| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| +|modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| +|modelSuffix|The suffix of the generated model.| |null| +|ngVersion|The version of Angular.| |8.0.0| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| -|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| -|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| -|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| -|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| -|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false| +|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0).| |false| -|ngVersion|The version of Angular.| |8.0.0| -|apiModulePrefix|The prefix of the generated ApiModule.| |null| -|serviceSuffix|The suffix of the generated service.| |Service| |serviceFileSuffix|The suffix of the file of the generated service (service<suffix>.ts).| |.service| -|modelSuffix|The suffix of the generated model.| |null| -|modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| -|fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| +|serviceSuffix|The suffix of the generated service.| |Service| +|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |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| |stringEnums|Generate string enums instead of objects for enum values.| |false| +|supportsES6|Generate code that conforms to ES6.| |false| +|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false| +|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| +|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| ## IMPORT MAPPING @@ -44,94 +44,94 @@ sidebar_label: typescript-angular ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                            • Blob
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • string
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Error
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • String
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • Double
                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                            • any
                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • Blob
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                                                              • Date
                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • Double
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • Error
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                                                                                              • Float
                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                                                                                              • Long
                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                                                                                              • Map
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • any
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                                                                                                                                                              • object
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                              • synchronized
                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • await
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • byte
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                                • debugger
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • delete
                                                                                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • double
                                                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                                                                                                                                                                • export
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • formParams
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • long
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • native
                                                                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • formParams
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • byte
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • double
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                                                                • transient
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • delete
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • long
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • native
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • await
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                                • typeof
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/generators/typescript-angularjs.md b/docs/generators/typescript-angularjs.md index e4789789c04d..932d469935b9 100644 --- a/docs/generators/typescript-angularjs.md +++ b/docs/generators/typescript-angularjs.md @@ -5,12 +5,12 @@ sidebar_label: typescript-angularjs | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |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| |supportsES6|Generate code that conforms to ES6.| |false| ## IMPORT MAPPING @@ -28,93 +28,93 @@ sidebar_label: typescript-angularjs ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                • string
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • Error
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • String
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • Double
                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                • any
                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                  • Date
                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                  • Integer
                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • Double
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • Error
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • File
                                                                                                                                                                                                                                                                                                                                                                                                  • Float
                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • Integer
                                                                                                                                                                                                                                                                                                                                                                                                  • Long
                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                  • File
                                                                                                                                                                                                                                                                                                                                                                                                  • Map
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • any
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                                                                                                                                                  • object
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                  • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • await
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                                    • debugger
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                                    • export
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • formParams
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • native
                                                                                                                                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • formParams
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                                                                    • transient
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • native
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • await
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                                    • typeof
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                                                    • volatile
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 630149f0ec06..6f65c5174f65 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -5,16 +5,16 @@ sidebar_label: typescript-aurelia | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |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| +|supportsES6|Generate code that conforms to ES6.| |false| ## IMPORT MAPPING @@ -31,93 +31,93 @@ sidebar_label: typescript-aurelia ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                    • string
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • Error
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • String
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • Double
                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                    • any
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                      • Array
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                      • Date
                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                      • Integer
                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                      • Array
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • Double
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • Error
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                                                                                                      • Float
                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                      • number
                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • Integer
                                                                                                                                                                                                                                                                                                                                                                                                      • Long
                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                                                                                                      • Map
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • any
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • number
                                                                                                                                                                                                                                                                                                                                                                                                      • object
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                      • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • await
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • boolean
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • byte
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • char
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                                                                                                                                        • debugger
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • delete
                                                                                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • float
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • double
                                                                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                                                                                                                                                                                        • export
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • float
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • formParams
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • goto
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • int
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • long
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • native
                                                                                                                                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • short
                                                                                                                                                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • void
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • formParams
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • byte
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • double
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                                                                        • transient
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • delete
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • long
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • goto
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • native
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • await
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                                                        • typeof
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • void
                                                                                                                                                                                                                                                                                                                                                                                                        • volatile
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • int
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                                                        • with
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • boolean
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • char
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • short
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 2ce7e5c1978f..7df54bceb8f5 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -5,17 +5,17 @@ sidebar_label: typescript-axios | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| -|npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|supportsES6|Generate code that conforms to ES6.| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| |withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes| |false| |withoutPrefixEnums|Don't prefix enum names with class names| |false| @@ -35,93 +35,93 @@ sidebar_label: typescript-axios ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                        • string
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • Error
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • Double
                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                        • any
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Array
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                          • Date
                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                          • Integer
                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                          • Array
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Error
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • File
                                                                                                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                          • number
                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Integer
                                                                                                                                                                                                                                                                                                                                                                                                          • Long
                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                          • File
                                                                                                                                                                                                                                                                                                                                                                                                          • Map
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • any
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • number
                                                                                                                                                                                                                                                                                                                                                                                                          • object
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • string
                                                                                                                                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                          • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • await
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • byte
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • char
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                                                                                                                                                            • debugger
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • delete
                                                                                                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • float
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • double
                                                                                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • enum
                                                                                                                                                                                                                                                                                                                                                                                                            • export
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • float
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • formParams
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • int
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • long
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • native
                                                                                                                                                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • short
                                                                                                                                                                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • formParams
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • byte
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • double
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • enum
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                                                            • transient
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • delete
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • long
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • native
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • await
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                                                            • typeof
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                                                                                                                                                                            • volatile
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • int
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • char
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • short
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index c46d4226c97a..98a52b89d78a 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -5,21 +5,21 @@ sidebar_label: typescript-fetch | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| -|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| -|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| -|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| -|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true| +|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| |prefixParameterInterfaces|Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |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| +|supportsES6|Generate code that conforms to ES6.| |false| |typescriptThreePlus|Setting this property to true will generate TypeScript 3.6+ compatible code.| |false| +|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true| +|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| ## IMPORT MAPPING @@ -36,118 +36,118 @@ sidebar_label: typescript-fetch ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                            • string
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • Error
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • String
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • Double
                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                            • any
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                              • Date
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Double
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Error
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                                                                                                              • Float
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                                                                                                              • Long
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                                                                                                              • Map
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • any
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                                                                                                                                                                              • object
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                              • ModelPropertyNaming
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • HTTPHeaders
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • Configuration
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • debugger
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • COLLECTION_FORMATS
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • do
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • float
                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                              • while
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                • ApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • BASE_PATH
                                                                                                                                                                                                                                                                                                                                                                                                                • BaseAPI
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • ApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • BlobApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • COLLECTION_FORMATS
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • Configuration
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • ConfigurationParameters
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • FetchAPI
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • FetchParams
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPBody
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPHeaders
                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPMethod
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseContext
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPQuery
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • JSONApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • Middleware
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • ModelPropertyNaming
                                                                                                                                                                                                                                                                                                                                                                                                                • RequestContext
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • export
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • RequestOpts
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • RequiredError
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseContext
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseTransformer
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • TextApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • VoidApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • await
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                                                • byte
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • configuration
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • debugger
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • delete
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                                                                                                • double
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseTransformer
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • Middleware
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • exists
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • export
                                                                                                                                                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • transient
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • BlobApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • configuration
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • BASE_PATH
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • JSONApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • ConfigurationParameters
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • delete
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                                                • long
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • TextApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                                                • native
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • await
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • RequestOpts
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • FetchAPI
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • RequiredError
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • FetchParams
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPBody
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • exists
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPQuery
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • VoidApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • transient
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 6df5d833cc5e..c3bf2d710faf 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -5,21 +5,21 @@ sidebar_label: typescript-inversify | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| -|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| -|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |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| +|supportsES6|Generate code that conforms to ES6.| |false| +|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false| |usePromise|Setting this property to use promise instead of observable inside every service.| |false| |useRxJS6|Setting this property to use rxjs 6 instead of rxjs 5.| |false| -|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false| +|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| ## IMPORT MAPPING @@ -36,95 +36,95 @@ sidebar_label: typescript-inversify ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                                • Blob
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • string
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • Error
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • String
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • Double
                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                • any
                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Blob
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                  • Date
                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                  • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Double
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Error
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • File
                                                                                                                                                                                                                                                                                                                                                                                                                  • Float
                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                  • Long
                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                  • File
                                                                                                                                                                                                                                                                                                                                                                                                                  • Map
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • any
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                                                                                                                                                                  • object
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                                  • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • await
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                                                    • debugger
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                                                    • export
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • map
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • native
                                                                                                                                                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                                                                                    • transient
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • native
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • await
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • map
                                                                                                                                                                                                                                                                                                                                                                                                                    • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                                                                    • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index e0d11461d1d2..07d320ffe87a 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -5,18 +5,18 @@ sidebar_label: typescript-jquery | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |false| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| -|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| -|jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |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| +|supportsES6|Generate code that conforms to ES6.| |false| ## IMPORT MAPPING @@ -33,93 +33,93 @@ sidebar_label: typescript-jquery ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                                    • string
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • Error
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • String
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • Double
                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                    • any
                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Array
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                      • Date
                                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                                      • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                                      • Array
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Double
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Error
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                                                                                                                      • Float
                                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                                      • number
                                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                      • Long
                                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                                      • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                                                                      • File
                                                                                                                                                                                                                                                                                                                                                                                                                      • Map
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Object
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • String
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • any
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • number
                                                                                                                                                                                                                                                                                                                                                                                                                      • object
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • string
                                                                                                                                                                                                                                                                                                                                                                                                                      ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                                      • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • await
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • byte
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • char
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                                                                                                                                                        • debugger
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • delete
                                                                                                                                                                                                                                                                                                                                                                                                                        • do
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • float
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • continue
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • double
                                                                                                                                                                                                                                                                                                                                                                                                                        • else
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • catch
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                                                                                                                                                                                                        • export
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • float
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • function
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • goto
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                        • if
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • case
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • int
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • let
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • long
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • native
                                                                                                                                                                                                                                                                                                                                                                                                                        • new
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                                                                                        • package
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • protected
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • short
                                                                                                                                                                                                                                                                                                                                                                                                                        • static
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • void
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • in
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • byte
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • double
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • finally
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                        • this
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • enum
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • extends
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • null
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                                                                                        • transient
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • final
                                                                                                                                                                                                                                                                                                                                                                                                                        • true
                                                                                                                                                                                                                                                                                                                                                                                                                        • try
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • implements
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • private
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • const
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • import
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • for
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • interface
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • delete
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • long
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • switch
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • default
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • goto
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • public
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • native
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • await
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • class
                                                                                                                                                                                                                                                                                                                                                                                                                        • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • break
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • var
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • void
                                                                                                                                                                                                                                                                                                                                                                                                                        • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • int
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • super
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • while
                                                                                                                                                                                                                                                                                                                                                                                                                        • with
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • throw
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • char
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • short
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • return
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • yield
                                                                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index 4d9e1d36e2ea..331905fd5c9c 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -5,17 +5,17 @@ sidebar_label: typescript-node | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| -|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|supportsES6|Generate code that conforms to ES6.| |false| ## IMPORT MAPPING @@ -32,97 +32,97 @@ sidebar_label: typescript-node ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                                        • Buffer
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • string
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • Error
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • String
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • RequestDetailedFile
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • Double
                                                                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                                                                        • any
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • Array
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • Buffer
                                                                                                                                                                                                                                                                                                                                                                                                                          • Date
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • Array
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • Double
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • Error
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • File
                                                                                                                                                                                                                                                                                                                                                                                                                          • Float
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • number
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • ReadStream
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                          • Long
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • Map
                                                                                                                                                                                                                                                                                                                                                                                                                          • Object
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • ReadStream
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • RequestDetailedFile
                                                                                                                                                                                                                                                                                                                                                                                                                          • RequestFile
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • File
                                                                                                                                                                                                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                                                                                                                                                                                                          • Map
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • String
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • any
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • number
                                                                                                                                                                                                                                                                                                                                                                                                                          • object
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                          • string
                                                                                                                                                                                                                                                                                                                                                                                                                          ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                                          • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • await
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • byte
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • char
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                                                                                                                                                                            • debugger
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • delete
                                                                                                                                                                                                                                                                                                                                                                                                                            • do
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • float
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • continue
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • double
                                                                                                                                                                                                                                                                                                                                                                                                                            • else
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • catch
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • enum
                                                                                                                                                                                                                                                                                                                                                                                                                            • export
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • float
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • function
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                            • if
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • case
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • int
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • let
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • long
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • native
                                                                                                                                                                                                                                                                                                                                                                                                                            • new
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                                                                                            • package
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • protected
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • short
                                                                                                                                                                                                                                                                                                                                                                                                                            • static
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • in
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • byte
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • double
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • finally
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                            • this
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • enum
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • extends
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • null
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                                                                            • transient
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • final
                                                                                                                                                                                                                                                                                                                                                                                                                            • true
                                                                                                                                                                                                                                                                                                                                                                                                                            • try
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • implements
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • private
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • const
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • import
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • for
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • interface
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • delete
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • long
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • switch
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • default
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • goto
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • public
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • native
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • await
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • class
                                                                                                                                                                                                                                                                                                                                                                                                                            • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • break
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • false
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • var
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • void
                                                                                                                                                                                                                                                                                                                                                                                                                            • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • int
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • super
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • while
                                                                                                                                                                                                                                                                                                                                                                                                                            • with
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • throw
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • char
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • short
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • return
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • yield
                                                                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index 89b061d760d1..1bdb95c142f1 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -5,19 +5,19 @@ sidebar_label: typescript-redux-query | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| -|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| -|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |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| +|supportsES6|Generate code that conforms to ES6.| |false| |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true| +|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| ## IMPORT MAPPING @@ -34,116 +34,116 @@ sidebar_label: typescript-redux-query ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                                            • string
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • Error
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • String
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • Double
                                                                                                                                                                                                                                                                                                                                                                                                                            • -
                                                                                                                                                                                                                                                                                                                                                                                                                            • any
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                              • Date
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Array
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • Double
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • Error
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                                                                                                                              • Float
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                              • Long
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • File
                                                                                                                                                                                                                                                                                                                                                                                                                              • Map
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • Object
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • String
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • any
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • number
                                                                                                                                                                                                                                                                                                                                                                                                                              • object
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                              • string
                                                                                                                                                                                                                                                                                                                                                                                                                              ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                                              • ModelPropertyNaming
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • HTTPHeaders
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Configuration
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • debugger
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • COLLECTION_FORMATS
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • do
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • float
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • while
                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • ApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • BASE_PATH
                                                                                                                                                                                                                                                                                                                                                                                                                                • BaseAPI
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • ApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • BlobApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • COLLECTION_FORMATS
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • Configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • ConfigurationParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPBody
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPHeaders
                                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPMethod
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseContext
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPQuery
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • JSONApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • Middleware
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • ModelPropertyNaming
                                                                                                                                                                                                                                                                                                                                                                                                                                • RequestContext
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • export
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • RequestOpts
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • RequiredError
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseContext
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseTransformer
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • TextApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • VoidApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • await
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                                                                • byte
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • case
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • catch
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • continue
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • debugger
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • delete
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • do
                                                                                                                                                                                                                                                                                                                                                                                                                                • double
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • ResponseTransformer
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Middleware
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • else
                                                                                                                                                                                                                                                                                                                                                                                                                                • enum
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • exists
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • export
                                                                                                                                                                                                                                                                                                                                                                                                                                • extends
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • transient
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • BlobApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                                                                • final
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • finally
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • float
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • function
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • if
                                                                                                                                                                                                                                                                                                                                                                                                                                • implements
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • const
                                                                                                                                                                                                                                                                                                                                                                                                                                • import
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • BASE_PATH
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • for
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • JSONApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • in
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                                                                                                • interface
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • ConfigurationParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • delete
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • let
                                                                                                                                                                                                                                                                                                                                                                                                                                • long
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • TextApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • default
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • goto
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                                                                • native
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • await
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • RequestOpts
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • class
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • break
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • false
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • new
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • null
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • package
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • private
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • protected
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • public
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • RequiredError
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • int
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • static
                                                                                                                                                                                                                                                                                                                                                                                                                                • super
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPBody
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • switch
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • this
                                                                                                                                                                                                                                                                                                                                                                                                                                • throw
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • char
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • short
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • exists
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • HTTPQuery
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • return
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • VoidApiResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • transient
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • true
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • try
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • var
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • void
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • while
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • with
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                • yield
                                                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index d5d43d6208e9..3d8bf8a33180 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -5,17 +5,17 @@ sidebar_label: typescript-rxjs | Option | Description | Values | Default | | ------ | ----------- | ------ | ------- | -|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| -|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| -|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| -|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| -|supportsES6|Generate code that conforms to ES6.| |false| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| +|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false| -|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|supportsES6|Generate code that conforms to ES6.| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| ## IMPORT MAPPING @@ -33,112 +33,112 @@ sidebar_label: typescript-rxjs ## LANGUAGE PRIMITIVES -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Blob
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • string
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Error
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • String
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Double
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • any
                                                                                                                                                                                                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Blob
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Date
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Array
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Double
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Error
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • File
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Float
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Integer
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Long
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • File
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Map
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Object
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • String
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • any
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • number
                                                                                                                                                                                                                                                                                                                                                                                                                                  • object
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                  • string
                                                                                                                                                                                                                                                                                                                                                                                                                                  ## RESERVED WORDS -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • ModelPropertyNaming
                                                                                                                                                                                                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                                                                                                                                                                                                  • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • AjaxRequest
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • AjaxResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • BASE_PATH
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • BaseAPI
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • COLLECTION_FORMATS
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ConfigurationParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • HttpBody
                                                                                                                                                                                                                                                                                                                                                                                                                                    • HttpHeaders
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • HttpMethod
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • HttpQuery
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Middleware
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ModelPropertyNaming
                                                                                                                                                                                                                                                                                                                                                                                                                                    • RequestArgs
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • RequestOpts
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • RequiredError
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ResponseArgs
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • await
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                                                                    • debugger
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • COLLECTION_FORMATS
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • HttpBody
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                                                                                                                                                                                                                    • do
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • BaseAPI
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • continue
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                                                                                                                                                                                                    • else
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • catch
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • exists
                                                                                                                                                                                                                                                                                                                                                                                                                                    • export
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • float
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • function
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • headerParams
                                                                                                                                                                                                                                                                                                                                                                                                                                    • if
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • case
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • let
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • native
                                                                                                                                                                                                                                                                                                                                                                                                                                    • new
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                                                                                                    • package
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • protected
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • queryParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                                                                                    • static
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • in
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • formParams
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • byte
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • double
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • finally
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • synchronized
                                                                                                                                                                                                                                                                                                                                                                                                                                    • this
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • Middleware
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • enum
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • extends
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • null
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                                                                                                    • transient
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • final
                                                                                                                                                                                                                                                                                                                                                                                                                                    • true
                                                                                                                                                                                                                                                                                                                                                                                                                                    • try
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • HttpMethod
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • implements
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • private
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • const
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • import
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • BASE_PATH
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • for
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • interface
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ConfigurationParameters
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • delete
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • long
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • switch
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • default
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • goto
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • AjaxRequest
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • public
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • native
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ResponseArgs
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • await
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • RequestOpts
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • class
                                                                                                                                                                                                                                                                                                                                                                                                                                    • typeof
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • break
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • HttpQuery
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • AjaxResponse
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • false
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • useFormData
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • var
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalDeferred
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • varLocalPath
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • void
                                                                                                                                                                                                                                                                                                                                                                                                                                    • volatile
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • abstract
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • requestOptions
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • RequiredError
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • int
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • instanceof
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • super
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • while
                                                                                                                                                                                                                                                                                                                                                                                                                                    • with
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • throw
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • char
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • short
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • exists
                                                                                                                                                                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                                                                                                                                                                    • return
                                                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                                                    • yield
                                                                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/installation.md b/docs/installation.md index 16cc1005f08b..60105c9a9bcd 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -20,11 +20,11 @@ npm install @openapitools/openapi-generator-cli -g ``` To install a specific version of the tool, pass the version during installation: - + ```bash -npm install @openapitools/openapi-generator-cli@cli-3.3.4 -g +npm install @openapitools/openapi-generator-cli@cli-4.2.2 -g ``` - + To install the tool as a dev dependency in your current project: ```bash @@ -77,21 +77,23 @@ docker run --rm \ > **Platform(s)**: Linux, macOS, Windows + If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar` For **Mac/Linux** users: ```bash -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar -O openapi-generator-cli.jar +wget https//repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.2/openapi-generator-cli-4.2.2.jar ``` + After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. diff --git a/docs/plugins.md b/docs/plugins.md index 213c83999219..2b46257e3985 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -51,7 +51,7 @@ To include in your project, add the following to `build.gradle`: buildscript { repositories { mavenLocal() - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4" @@ -96,4 +96,4 @@ openApiGenerate { dateLibrary: "java8" ] } -``` \ No newline at end of file +``` diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java index feb0f35f7416..8e55421c7bdd 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ConfigHelp.java @@ -32,6 +32,9 @@ import java.nio.file.Paths; import java.util.Locale; import java.util.Map; +import java.util.TreeMap; +import java.util.function.Function; +import java.util.stream.Collectors; import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4; import static org.apache.commons.lang3.StringUtils.isEmpty; @@ -164,12 +167,18 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { sb.append("| Option | Description | Values | Default |").append(newline); sb.append("| ------ | ----------- | ------ | ------- |").append(newline); - for (CliOption langCliOption : config.cliOptions()) { + Map langCliOptions = config.cliOptions() + .stream() + .collect(Collectors.toMap(CliOption::getOpt, Function.identity(), (a, b) -> { + throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a.getOpt(), b.getOpt())); + }, TreeMap::new)); + + langCliOptions.forEach((key, langCliOption) -> { // start sb.append("|"); // option - sb.append(escapeHtml4(langCliOption.getOpt())).append("|"); + sb.append(escapeHtml4(key)).append("|"); // description sb.append(escapeHtml4(langCliOption.getDescription())).append("|"); @@ -193,7 +202,7 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { sb.append(escapeHtml4(langCliOption.getDefault())).append("|"); sb.append(newline); - } + }); if (Boolean.TRUE.equals(importMappings)) { @@ -205,10 +214,14 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { sb.append("| Type/Alias | Imports |").append(newline); sb.append("| ---------- | ------- |").append(newline); - config.importMapping().forEach((key, value)-> { - sb.append("|").append(escapeHtml4(key)).append("|").append(escapeHtml4(value)).append("|"); - sb.append(newline); - }); + config.importMapping() + .entrySet() + .stream() + .sorted(Map.Entry.comparingByKey()) + .forEachOrdered(kvp -> { + sb.append("|").append(escapeHtml4(kvp.getKey())).append("|").append(escapeHtml4(kvp.getValue())).append("|"); + sb.append(newline); + }); sb.append(newline); } @@ -222,10 +235,14 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { sb.append("| Type/Alias | Instantiated By |").append(newline); sb.append("| ---------- | --------------- |").append(newline); - config.instantiationTypes().forEach((key, value)-> { - sb.append("|").append(escapeHtml4(key)).append("|").append(escapeHtml4(value)).append("|"); - sb.append(newline); - }); + config.instantiationTypes() + .entrySet() + .stream() + .sorted(Map.Entry.comparingByKey()) + .forEachOrdered(kvp -> { + sb.append("|").append(escapeHtml4(kvp.getKey())).append("|").append(escapeHtml4(kvp.getValue())).append("|"); + sb.append(newline); + }); sb.append(newline); } @@ -236,7 +253,10 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { sb.append(newline); sb.append(newline); sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                      "); - config.languageSpecificPrimitives().forEach(s -> sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(escapeHtml4(s)).append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(newline)); + config.languageSpecificPrimitives() + .stream() + .sorted(String::compareTo) + .forEach(s -> sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(escapeHtml4(s)).append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(newline)); sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    "); sb.append(newline); } @@ -247,7 +267,10 @@ private void generateMarkdownHelp(StringBuilder sb, CodegenConfig config) { sb.append(newline); sb.append(newline); sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                      "); - config.reservedWords().forEach(s -> sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(escapeHtml4(s)).append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(newline)); + config.reservedWords() + .stream() + .sorted(String::compareTo) + .forEach(s -> sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(escapeHtml4(s)).append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    • ").append(newline)); sb.append("
                                                                                                                                                                                                                                                                                                                                                                                                                                    "); sb.append(newline); } @@ -294,21 +317,32 @@ private void generatePlainTextHelp(StringBuilder sb, CodegenConfig config) { String optIndent = "\t"; String optNestedIndent = "\t "; - for (CliOption langCliOption : config.cliOptions()) { - sb.append(optIndent).append(langCliOption.getOpt()); + Map langCliOptions = config.cliOptions() + .stream() + .collect(Collectors.toMap(CliOption::getOpt, Function.identity(), (a, b) -> { + throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a.getOpt(), b.getOpt())); + }, TreeMap::new)); + + langCliOptions.forEach((key, langCliOption) -> { + sb.append(optIndent).append(key); sb.append(newline); sb.append(optNestedIndent).append(langCliOption.getOptionHelp() .replaceAll("\n", System.lineSeparator() + optNestedIndent)); sb.append(newline); sb.append(newline); - } + }); if (Boolean.TRUE.equals(importMappings)) { sb.append(newline); sb.append("IMPORT MAPPING"); sb.append(newline); sb.append(newline); - Map map = config.importMapping(); + Map map = config.importMapping() + .entrySet() + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a, b) -> { + throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a, b)); + }, TreeMap::new)); writePlainTextFromMap(sb, map, optIndent, optNestedIndent, "Type/Alias", "Imports"); sb.append(newline); } @@ -318,7 +352,12 @@ private void generatePlainTextHelp(StringBuilder sb, CodegenConfig config) { sb.append("INSTANTIATION TYPES"); sb.append(newline); sb.append(newline); - Map map = config.instantiationTypes(); + Map map = config.instantiationTypes() + .entrySet() + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (a, b) -> { + throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a, b)); + }, TreeMap::new)); writePlainTextFromMap(sb, map, optIndent, optNestedIndent, "Type/Alias", "Instantiated By"); sb.append(newline); } @@ -389,7 +428,7 @@ private void writePlainTextFromArray(StringBuilder sb, String[] arr, String optI for (int i = 0; i < arr.length; i++) { String current = arr[i]; sb.append(optIndent).append(String.format(Locale.ROOT, format, current)); - if (i % columns == 0) { + if ((i + 1) % columns == 0) { sb.append(newline); } } diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java index a9270dc41d6c..3cab8cf65631 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/ListGenerators.java @@ -25,6 +25,9 @@ public class ListGenerators implements Runnable { @Option(name = {"-d", "--docsite" }, description = "format for docusaurus site output", hidden = true) private Boolean docusaurus = false; + @Option(name = {"--github-nested-index" }, description = "format for github index at docs/generators/README.md", hidden = true) + private Boolean githubNestedIndex = false; + @Option(name = {"-i", "--include" }, description = "comma-separated list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default.", allowedValues = { "all", "beta", "stable", "experimental", "deprecated" }) @@ -85,7 +88,7 @@ private void appendForType(StringBuilder sb, CodegenType type, String typeName, .collect(Collectors.toList()); if(!list.isEmpty()) { - if (docusaurus) { + if (docusaurus || githubNestedIndex) { sb.append("## ").append(typeName).append(" generators"); } else { sb.append(typeName).append(" generators:"); @@ -94,9 +97,10 @@ private void appendForType(StringBuilder sb, CodegenType type, String typeName, list.forEach(generator -> { GeneratorMetadata meta = generator.getGeneratorMetadata(); - if (docusaurus) { + if (docusaurus || githubNestedIndex) { sb.append("* "); - String id = "generators/" + generator.getName() + ".md"; + String idPrefix = docusaurus ? "generators/" : ""; + String id = idPrefix + generator.getName() + ".md"; sb.append("[").append(generator.getName()); if (meta != null && meta.getStability() != null && meta.getStability() != Stability.STABLE) { diff --git a/modules/openapi-generator-gradle-plugin/README.adoc b/modules/openapi-generator-gradle-plugin/README.adoc index 88ef8a1f5eda..0f97dfb55108 100644 --- a/modules/openapi-generator-gradle-plugin/README.adoc +++ b/modules/openapi-generator-gradle-plugin/README.adoc @@ -56,7 +56,7 @@ Using https://docs.gradle.org/current/userguide/plugins.html#sec:old_plugin_appl buildscript { repositories { mavenLocal() - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } // or, via Gradle Plugin Portal: // url "https://plugins.gradle.org/m2/" } diff --git a/modules/openapi-generator-gradle-plugin/build.gradle b/modules/openapi-generator-gradle-plugin/build.gradle index 8dd9dfa068f9..d6886b217568 100644 --- a/modules/openapi-generator-gradle-plugin/build.gradle +++ b/modules/openapi-generator-gradle-plugin/build.gradle @@ -2,7 +2,7 @@ buildscript { ext.kotlin_version = '1.3.20' repositories { mavenLocal() - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } maven { url "https://plugins.gradle.org/m2/" } @@ -46,7 +46,7 @@ targetCompatibility = 1.8 repositories { jcenter() - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } mavenLocal() maven { url "https://oss.sonatype.org/content/repositories/releases/" diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle index 6241891c6059..70d810a83cb5 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle @@ -1,7 +1,7 @@ buildscript { repositories { mavenLocal() - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } maven { url "https://plugins.gradle.org/m2/" } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index 7bdbad35edd0..5a039966b2c7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -114,6 +114,9 @@ public class CodegenConstants { public static final String LICENSE_NAME = "licenseName"; public static final String LICENSE_NAME_DESC = "The name of the license"; + public static final String LICENSE_ID = "licenseId"; + public static final String LICENSE_ID_DESC = "The identifier of the license"; + public static final String LICENSE_URL = "licenseUrl"; public static final String LICENSE_URL_DESC = "The URL of the license"; @@ -336,4 +339,7 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String ENUM_CLASS_PREFIX = "enumClassPrefix"; public static final String ENUM_CLASS_PREFIX_DESC = "Prefix enum with class name"; + + public static final String PACKAGE_TAGS = "packageTags"; + public static final String PACKAGE_TAGS_DESC = "Tags to identify the package"; } 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 f10a71d75eef..06a286f24f07 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 @@ -136,6 +136,10 @@ public class DefaultCodegen implements CodegenConfig { protected String modelNamePrefix = "", modelNameSuffix = ""; protected String apiNameSuffix = "Api"; protected String testPackage = ""; + /* + apiTemplateFiles are for API outputs only (controllers/handlers). + API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group. + */ protected Map apiTemplateFiles = new HashMap(); protected Map modelTemplateFiles = new HashMap(); protected Map apiTestTemplateFiles = new HashMap(); @@ -149,6 +153,11 @@ public class DefaultCodegen implements CodegenConfig { protected Map additionalProperties = new HashMap(); protected Map serverVariables = new HashMap(); protected Map vendorExtensions = new HashMap(); + /* + Supporting files are those which aren't models, APIs, or docs. + These get a different map of data bound to the templates. Supporting files are written once. + See also 'apiTemplateFiles'. + */ protected List supportingFiles = new ArrayList(); protected List cliOptions = new ArrayList(); protected boolean skipOverwrite; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java index d97c2d800b9a..f17168d19d78 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpNetCoreClientCodegen.java @@ -80,6 +80,9 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen { protected boolean nonPublicApi = Boolean.FALSE; protected boolean caseInsensitiveResponseHeaders = Boolean.FALSE; + protected String releaseNote = "Minor update"; + protected String licenseId; + protected String packageTags; public CSharpNetCoreClientCodegen() { super(); @@ -163,6 +166,18 @@ public CSharpNetCoreClientCodegen() { CodegenConstants.INTERFACE_PREFIX_DESC, interfacePrefix); + addOption(CodegenConstants.LICENSE_ID, + CodegenConstants.LICENSE_ID_DESC, + this.licenseId); + + addOption(CodegenConstants.RELEASE_NOTE, + CodegenConstants.RELEASE_NOTE_DESC, + this.releaseNote); + + addOption(CodegenConstants.PACKAGE_TAGS, + CodegenConstants.PACKAGE_TAGS_DESC, + this.packageTags); + CliOption framework = new CliOption( CodegenConstants.DOTNET_FRAMEWORK, CodegenConstants.DOTNET_FRAMEWORK_DESC @@ -699,6 +714,18 @@ public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveRespo this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; } + public void setLicenseId(String licenseId) { + this.licenseId = licenseId; + } + + public void setReleaseNote(String releaseNote) { + this.releaseNote = releaseNote; + } + + public void setPackageTags(String packageTags) { + this.packageTags = packageTags; + } + @Override public String toEnumVarName(String value, String datatype) { if (value.length() == 0) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java index 22150b58bfd1..292a41fdc3e2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppQt5AbstractCodegen.java @@ -21,10 +21,13 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen protected String apiVersion = "1.0.0"; protected static final String CPP_NAMESPACE = "cppNamespace"; protected static final String CPP_NAMESPACE_DESC = "C++ namespace (convention: name::space::for::api)."; + protected static final String CONTENT_COMPRESSION_ENABLED = "contentCompression"; + protected static final String CONTENT_COMPRESSION_ENABLED_DESC = "Enable Compressed Content Encoding for requests and responses"; protected Set foundationClasses = new HashSet(); protected String cppNamespace = "OpenAPI"; protected Map namespaces = new HashMap(); protected Set systemIncludes = new HashSet(); + protected boolean isContentCompressionEnabled = false; protected Set nonFrameworkPrimitives = new HashSet(); @@ -56,6 +59,7 @@ public CppQt5AbstractCodegen() { // CLI options addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace); addOption(CodegenConstants.MODEL_NAME_PREFIX, CodegenConstants.MODEL_NAME_PREFIX_DESC, this.modelNamePrefix); + addSwitch(CONTENT_COMPRESSION_ENABLED, CONTENT_COMPRESSION_ENABLED_DESC, this.isContentCompressionEnabled); /* * Additional Properties. These values can be passed to the templates and @@ -137,6 +141,11 @@ public void processOpts() { typeMapping.put("object", modelNamePrefix + "Object"); additionalProperties().put("prefix", modelNamePrefix); } + if (additionalProperties.containsKey(CONTENT_COMPRESSION_ENABLED)) { + setContentCompressionEnabled(convertPropertyToBooleanAndWriteBack(CONTENT_COMPRESSION_ENABLED)); + } else { + additionalProperties.put(CONTENT_COMPRESSION_ENABLED, isContentCompressionEnabled); + } } @Override @@ -379,4 +388,8 @@ private boolean isIncluded(String type, List> imports) { } return included; } + + public void setContentCompressionEnabled(boolean flag) { + this.isContentCompressionEnabled = flag; + } } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java index 8cded7e4c04a..af85710ef74b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioClientCodegen.java @@ -245,11 +245,11 @@ public void processOpts() { typeMapping.put("date", "DateTime"); } else if ("timemachine".equals(dateLibrary)) { additionalProperties.put("timeMachine", "true"); - typeMapping.put("date", "LocalDate"); - typeMapping.put("Date", "LocalDate"); + typeMapping.put("date", "OffsetDate"); + typeMapping.put("Date", "OffsetDate"); typeMapping.put("DateTime", "OffsetDateTime"); typeMapping.put("datetime", "OffsetDateTime"); - importMapping.put("LocalDate", "package:time_machine/time_machine.dart"); + importMapping.put("OffsetDate", "package:time_machine/time_machine.dart"); importMapping.put("OffsetDateTime", "package:time_machine/time_machine.dart"); supportingFiles.add(new SupportingFile("local_date_serializer.mustache", libFolder, "local_date_serializer.dart")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java index 6a5bf184e8db..02a25cd9cf52 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java @@ -124,7 +124,7 @@ public ErlangClientCodegen() { cliOptions.clear(); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Erlang application name (convention: lowercase).") .defaultValue(this.packageName)); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Erlang application version") + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "Erlang application version") .defaultValue(this.packageVersion)); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java index 55a3a975c0de..b48eb615be4e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangProperCodegen.java @@ -130,7 +130,7 @@ public ErlangProperCodegen() { cliOptions.clear(); cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Erlang application name (convention: lowercase).") .defaultValue(this.packageName)); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Erlang application version") + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "Erlang application version") .defaultValue(this.packageVersion)); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java index f21ad4f5c4dd..c680ff5d19a5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSCXFCDIServerCodegen.java @@ -53,8 +53,6 @@ public JavaJAXRSCXFCDIServerCodegen() { // Updated template directory embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "cxf-cdi"; - - cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations",useBeanValidation)); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java index 2439d1fb7454..a8d53dfa2838 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaResteasyEapServerCodegen.java @@ -63,7 +63,6 @@ public JavaResteasyEapServerCodegen() { embeddedTemplateDir = templateDir = "JavaJaxRS" + File.separator + "resteasy" + File.separator + "eap"; - cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations",useBeanValidation)); cliOptions.add(CliOption.newBoolean(GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR, "Generate Jboss Deployment Descriptor",generateJbossDeploymentDescriptor)); cliOptions.add(CliOption.newBoolean(USE_SWAGGER_FEATURE, "Use dynamic Swagger generator",useSwaggerFeature)); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index e04bb05474be..ec62e93c3b80 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -287,7 +287,9 @@ private String robustImport(String name) { // name looks like cat.Cat String moduleName = name.split("\\.")[0]; // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - String modelImport = "try:\n from " + modelPackage() + " import "+ moduleName+ "\nexcept ImportError:\n "+moduleName+" = sys.modules['"+modelPackage() + "."+ moduleName+"']"; + String modelImport = "try:\n from " + modelPackage() + + " import " + moduleName+ "\nexcept ImportError:\n " + + moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; return modelImport; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index 454eb43b774e..eb669b02df10 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -236,8 +236,6 @@ public Swift4Codegen() { cliOptions.add(new CliOption(CodegenConstants.NON_PUBLIC_API, CodegenConstants.NON_PUBLIC_API_DESC + "(default: false)")); - cliOptions.add(new CliOption(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, - CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC)); cliOptions.add(new CliOption(UNWRAP_REQUIRED, "Treat 'required' properties in response as non-optional " + "(which would crash the app if api returns null as opposed " diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 094eec48df64..5bc9f1ad4d4d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -221,8 +221,6 @@ public Swift5ClientCodegen() { cliOptions.add(new CliOption(CodegenConstants.NON_PUBLIC_API, CodegenConstants.NON_PUBLIC_API_DESC + "(default: false)")); - cliOptions.add(new CliOption(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, - CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG_DESC)); cliOptions.add(new CliOption(OBJC_COMPATIBLE, "Add additional properties and methods for Objective-C " + "compatibility (default: false)")); diff --git a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache index 969998fd670a..915c6ab04bed 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache @@ -14,7 +14,7 @@ wrapper { buildscript { repositories { maven { url "https://repo1.maven.org/maven2" } - maven { url 'https://repo.jfrog.org/artifactory/gradle-plugins' } + maven { url = 'https://repo.jfrog.org/artifactory/gradle-plugins' } } dependencies { classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16') @@ -22,7 +22,7 @@ buildscript { } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } mavenLocal() } diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index abfb8653beca..69707eadc166 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { @@ -16,7 +16,7 @@ buildscript { } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index cd78d9e03d30..69170a031771 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index e190e36cdaa6..0089f90de782 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index 5a162a7d7106..30aa47428cb5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index a92d040f6237..cea6681a95e0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -6,13 +6,13 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index 67f7a7cda4a5..304b00a445a7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -9,7 +9,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 0caef5e4aa75..b04e53f1e966 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 5f716aad842c..59a0970f3582 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index 610d25d1473b..33d09ae83054 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache index 7431d90eba3b..fab2f0d9fe24 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 813886e4b560..ea96f0941652 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -6,7 +6,7 @@ version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index e135bc2212af..53bc7b9a8e59 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -5,7 +5,7 @@ group = '{{groupId}}' version = '{{artifactVersion}}' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache index 98e22a8af1e1..b1f08021b4ec 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache @@ -4,7 +4,7 @@ project.version = "{{artifactVersion}}" project.group = "{{groupId}}" repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache index 924376cb70d9..6427c11001bc 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/gradle.mustache @@ -4,7 +4,7 @@ project.version = "{{artifactVersion}}" project.group = "{{groupId}}" repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { diff --git a/modules/openapi-generator/src/main/resources/android/build.mustache b/modules/openapi-generator/src/main/resources/android/build.mustache index ea6766fa0539..c26f9b8967d9 100644 --- a/modules/openapi-generator/src/main/resources/android/build.mustache +++ b/modules/openapi-generator/src/main/resources/android/build.mustache @@ -5,7 +5,7 @@ project.version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache index f608fe18f737..7c6cb04c856e 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/build.mustache @@ -5,7 +5,7 @@ project.version = '{{artifactVersion}}' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache index 101e95cbfc4d..44218b0a8892 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache @@ -16,7 +16,20 @@ namespace {{packageName}}.Models /// [DataContract] public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{>enumClass}}{{/items}}{{/items.isEnum}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// @@ -34,6 +47,7 @@ namespace {{packageName}}.Models public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} {{/isEnum}} {{#hasMore}} + {{/hasMore}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache index fcb2200d5b73..899ccf61d9de 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache @@ -18,7 +18,20 @@ namespace {{modelPackage}} /// [DataContract] public {{#modelClassModifier}}{{modelClassModifier}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}}{{^isModel}}{{>enumClass}}{{/isModel}}{{/isEnum}}{{#items.isEnum}}{{^isModel}}{{#items}}{{>enumClass}}{{/items}}{{/isModel}}{{/items.isEnum}} + { + {{#vars}} + {{#items.isEnum}} + {{#items}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/items}} + {{/items.isEnum}} + {{#isEnum}} + {{^complexType}} +{{>enumClass}} + {{/complexType}} + {{/isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// {{#description}} @@ -37,6 +50,7 @@ namespace {{modelPackage}} public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} {{/isEnum}} {{#hasMore}} + {{/hasMore}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache index 31afee650ffa..71069bbf80ad 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache @@ -54,9 +54,9 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque auto {{paramName}}Query = request.query().get("{{baseName}}"); Pistache::Optional<{{^isContainer}}{{dataType}}{{/isContainer}}{{#isListContainer}}std::vector<{{items.baseType}}>{{/isListContainer}}> {{paramName}}; if(!{{paramName}}Query.isEmpty()){ - {{^isContainer}}{{dataType}}{{/isContainer}}{{#isListContainer}}std::vector<{{items.baseType}}>{{/isListContainer}} value; - if(fromStringValue({{paramName}}Query.get(), value)){ - {{paramName}} = Pistache::Some(value); + {{^isContainer}}{{dataType}}{{/isContainer}}{{#isListContainer}}std::vector<{{items.baseType}}>{{/isListContainer}} valueQuery_instance; + if(fromStringValue({{paramName}}Query.get(), valueQuery_instance)){ + {{paramName}} = Pistache::Some(valueQuery_instance); } } {{/queryParams}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache index c53100cca69b..74125fc936ec 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/CMakeLists.txt.mustache @@ -8,14 +8,15 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) +find_package(Qt5Network REQUIRED){{#contentCompression}} +find_package(ZLIB REQUIRED){{/contentCompression}} file(GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ) add_library(${PROJECT_NAME} ${SRCS}) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network ssl crypto) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network ssl crypto{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}}) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache index a28bbad0018e..933bb0c16989 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache @@ -6,7 +6,8 @@ #include #include #include -#include +#include {{#contentCompression}} +#include {{/contentCompression}} #include "{{prefix}}HttpRequest.h" @@ -95,6 +96,10 @@ void {{prefix}}HttpRequestWorker::setWorkingDirectory(const QString &path) { } } +void {{prefix}}HttpRequestWorker::setCompressionEnabled(bool enable) { + isCompressionEnabled = enable; +} + QString {{prefix}}HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; @@ -303,6 +308,10 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); } + if(isCompressionEnabled){ + request.setRawHeader("Accept-Encoding", "deflate, gzip"); + } + if (input->http_method == "GET") { reply = manager->get(request); } else if (input->http_method == "POST") { @@ -332,15 +341,14 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); - response = reply->readAll(); error_str = reply->errorString(); if (reply->rawHeaderPairs().count() > 0) { for (const auto &item : reply->rawHeaderPairs()) { headers.insert(item.first, item.second); } } + process_response(reply); reply->deleteLater(); - process_form_response(); emit on_execution_finished(this); } @@ -354,7 +362,7 @@ void {{prefix}}HttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { emit on_execution_finished(this); } -void {{prefix}}HttpRequestWorker::process_form_response() { +void {{prefix}}HttpRequestWorker::process_response(QNetworkReply *reply) { if (getResponseHeaders().contains(QString("Content-Disposition"))) { auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts); auto contentType = @@ -368,18 +376,61 @@ void {{prefix}}HttpRequestWorker::process_form_response() { } } {{prefix}}HttpFileElement felement; - felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); + felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, reply->readAll()); files.insert(filename, felement); } } else if (getResponseHeaders().contains(QString("Content-Type"))) { auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts); if ((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))) { + // TODO : Handle Multipart responses } else { + if(headers.contains("Content-Encoding")){ + auto encoding = headers.value("Content-Encoding").split(QString(";"), QString::SkipEmptyParts); + if(encoding.count() > 0){ + auto compressionTypes = encoding.first().split(',', QString::SkipEmptyParts); + if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ + response = decompress(reply->readAll()); + } + } + } + else { + response = reply->readAll(); + } } } } +QByteArray {{prefix}}HttpRequestWorker::decompress(const QByteArray& data){ + QByteArray result; + bool sts = false;{{#contentCompression}} + do{ + z_stream strm{}; + static const int CHUNK_SIZE = 2048; + char out[CHUNK_SIZE]; + if (data.size() <= 4) { + break; + } + strm.avail_in = data.size(); + strm.next_in = (Bytef*)(data.data()); + if(Z_OK != inflateInit2(&strm, 15 + 32)){ + break; + } + do { + sts = false; + strm.avail_out = CHUNK_SIZE; + strm.next_out = (Bytef*)(out); + if(inflate(&strm, Z_NO_FLUSH) < Z_OK){ + break; + } + result.append(out, CHUNK_SIZE - strm.avail_out); + sts = true; + } while (strm.avail_out == 0); + inflateEnd(&strm); + } while(false);{{/contentCompression}} + return sts ? result : QByteArray(); +} + QSslConfiguration *{{prefix}}HttpRequestWorker::sslDefaultConfiguration; {{#cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache index 32ee8a2145d8..9df29d4f24bd 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache @@ -63,6 +63,7 @@ public: void setWorkingDirectory(const QString &path); {{prefix}}HttpFileElement getHttpFileElement(const QString &fieldname = QString()); QByteArray *getMultiPartField(const QString &fieldname = QString()); + void setCompressionEnabled(bool enable); signals: void on_execution_finished({{prefix}}HttpRequestWorker *worker); @@ -73,8 +74,10 @@ private: QMap multiPartFields; QString workingDirectory; int _timeOut; + bool isCompressionEnabled; void on_manager_timeout(QNetworkReply *reply); - void process_form_response(); + void process_response(QNetworkReply *reply); + QByteArray decompress(const QByteArray& data); private slots: void on_manager_finished(QNetworkReply *reply); }; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache index 854841518e2f..6b989b8c00e5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/Project.mustache @@ -40,5 +40,5 @@ SOURCES += \ # Others $${PWD}/{{prefix}}Helpers.cpp \ $${PWD}/{{prefix}}HttpRequest.cpp \ - $${PWD}/{{prefix}}HttpFileElement.cpp + $${PWD}/{{prefix}}HttpFileElement.cpp diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache index 7f24ba64a82a..451e05b6a18e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-body.mustache @@ -14,7 +14,8 @@ namespace {{this}} { _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} {{classname}}::~{{classname}}() { } @@ -47,6 +48,10 @@ void {{classname}}::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void {{classname}}::enableContentCompression() { + _compress = true; +} + {{#operations}} {{#operation}} void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { @@ -109,6 +114,7 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName {{prefix}}HttpRequestWorker *worker = new {{prefix}}HttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); {{prefix}}HttpRequestInput input(fullPath, "{{httpMethod}}"); {{#formParams}}{{^isFile}} input.add_var("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));{{/isFile}}{{#isFile}} @@ -144,6 +150,7 @@ void {{classname}}::{{nickname}}Callback({{prefix}}HttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } {{#returnType}} {{#isListContainer}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache index 8c877912e175..07a33698b588 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/api-header.mustache @@ -27,6 +27,7 @@ public: void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); {{#operations}}{{#operation}} void {{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/operation}}{{/operations}} @@ -37,6 +38,7 @@ private: int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; {{#operations}}{{#operation}} void {{nickname}}Callback({{prefix}}HttpRequestWorker *worker);{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache index a3fec02b66b9..59a3460326be 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Project.mustache @@ -22,10 +22,17 @@ Properties {{packageName}} {{packageName}} + {{packageDescription}} {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} {{targetFramework}} 512 - bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml + bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} + {{licenseId}}{{/licenseId}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git + git + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}{{#releaseNote}} + {{releaseNote}}{{/releaseNote}}{{#packageTags}} + {{{packageTags}}}{{/packageTags}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index f68d4c29a2cd..56c95a5e32be 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -16,7 +16,12 @@ true {{packageName}} {{packageVersion}} - bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml + bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} + {{licenseId}}{{/licenseId}} + https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git + git{{#releaseNote}} + {{releaseNote}}{{/releaseNote}}{{#packageTags}} + {{{packageTags}}}{{/packageTags}} diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache index 5b7ace703e8a..112fd77f9993 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache @@ -23,17 +23,17 @@ class {{classname}} { /// {{notes}} Future{{/returnType}}>{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}CancelToken cancelToken, Map headers,}) async { - String path = "{{{path}}}"{{#pathParams}}.replaceAll("{" + "{{baseName}}" + "}", {{{paramName}}}.toString()){{/pathParams}}; + String _path = "{{{path}}}"{{#pathParams}}.replaceAll("{" r'{{baseName}}' "}", {{{paramName}}}.toString()){{/pathParams}}; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); dynamic bodyData; {{#headerParams}} - headerParams["{{baseName}}"] = {{paramName}}; + headerParams[r'{{baseName}}'] = {{paramName}}; {{/headerParams}} {{#queryParams}} - queryParams["{{baseName}}"] = {{paramName}}; + queryParams[r'{{baseName}}'] = {{paramName}}; {{/queryParams}} queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); @@ -46,12 +46,12 @@ class {{classname}} { {{#isMultipart}} {{^isFile}} if ({{paramName}} != null) { - formData['{{baseName}}'] = parameterToString(_serializers, {{paramName}}); + formData[r'{{baseName}}'] = parameterToString(_serializers, {{paramName}}); } {{/isFile}} {{#isFile}} if ({{paramName}} != null) { - formData['{{baseName}}'] = MultipartFile.fromBytes({{paramName}}, filename: "{{baseName}}"); + formData[r'{{baseName}}'] = MultipartFile.fromBytes({{paramName}}, filename: r'{{baseName}}'); } {{/isFile}} {{/isMultipart}} @@ -72,7 +72,7 @@ class {{classname}} { {{/bodyParam}} return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( diff --git a/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache b/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache index 14d947b104d2..77029c39948e 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/apilib.mustache @@ -1,6 +1,5 @@ library {{pubName}}.api; -import 'package:http/io_client.dart'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; import 'package:{{pubName}}/serializers.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache index c7e26935d341..f0df6902f7a1 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache @@ -10,7 +10,7 @@ abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builde {{#isNullable}} @nullable {{/isNullable}} - @BuiltValueField(wireName: '{{baseName}}') + @BuiltValueField(wireName: r'{{baseName}}') {{{dataType}}} get {{name}}; {{#allowableValues}} {{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}} diff --git a/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache b/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache index 2fb73ef0aae6..86a9eac68c2e 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/local_date_serializer.mustache @@ -2,22 +2,44 @@ import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; import 'package:time_machine/time_machine.dart'; -class LocalDateSerializer implements PrimitiveSerializer { +class OffsetDateSerializer implements PrimitiveSerializer { @override - Iterable get types => BuiltList([LocalDate]); + Iterable get types => BuiltList([OffsetDate]); - @override - String get wireName => "LocalDate"; + @override + String get wireName => "OffsetDate"; + + @override + OffsetDate deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final local = LocalDate.dateTime(DateTime.parse(serialized as String)); + return OffsetDate(local, Offset(0)); + } + + @override + Object serialize(Serializers serializers, OffsetDate offsetDate, + {FullType specifiedType = FullType.unspecified}) { + return offsetDate.toString('yyyy-MM-dd'); + } +} - @override - LocalDate deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - return LocalDate.dateTime(DateTime.parse(serialized as String)); - } +class OffsetDateTimeSerializer implements PrimitiveSerializer { + @override + Iterable get types => BuiltList([OffsetDateTime]); + + @override + String get wireName => "OffsetDateTime"; - @override - Object serialize(Serializers serializers, LocalDate localDate, - {FullType specifiedType = FullType.unspecified}) { - return localDate.toString('yyyy-MM-dd'); - } + @override + OffsetDateTime deserialize(Serializers serializers, Object serialized, + {FullType specifiedType = FullType.unspecified}) { + final local = LocalDateTime.dateTime(DateTime.parse(serialized as String)); + return OffsetDateTime(local, Offset(0)); + } + + @override + Object serialize(Serializers serializers, OffsetDateTime offsetDateTime, + {FullType specifiedType = FullType.unspecified}) { + return offsetDateTime.toString(); + } } diff --git a/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache b/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache index 2d850a28c909..76ebd4a0dc6f 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/serializers.mustache @@ -4,7 +4,8 @@ import 'package:built_value/serializer.dart'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/json_object.dart'; import 'package:built_value/standard_json_plugin.dart'; -{{#timeMachine}}import 'package:{{pubName}}/local_date_serializer.dart';{{/timeMachine}} +{{#timeMachine}}import 'package:time_machine/time_machine.dart'; +import 'package:{{pubName}}/local_date_serializer.dart';{{/timeMachine}} {{#models}}{{#model}}import 'package:{{pubName}}/model/{{classFilename}}.dart'; {{/model}}{{/models}} @@ -25,4 +26,6 @@ const FullType(BuiltList, const [const FullType({{classname}})]), Serializers standardSerializers = (serializers.toBuilder() -{{#timeMachine}}..add(LocalDateSerializer()){{/timeMachine}}..addPlugin(StandardJsonPlugin())).build(); +{{#timeMachine}}..add(OffsetDateSerializer()) +..add(OffsetDateTimeSerializer()) +{{/timeMachine}}..addPlugin(StandardJsonPlugin())).build(); diff --git a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache index 7d9baf079c2c..c053e99c0d8e 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/api.mustache @@ -127,14 +127,16 @@ func (r api{{operationId}}Request) Execute() ({{#returnType}}{{{.}}}, {{/returnT {{#queryParams}} {{#required}} {{#isCollectionFormatMulti}} - t := *r.{{paramName}} - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + { + t := *r.{{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + } + } else { + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) } - } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache index 2e809addf425..765ba75fbe91 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache @@ -13,7 +13,7 @@ buildscript { {{/jvm-retrofit2}} repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -26,7 +26,7 @@ apply plugin: 'kotlin-kapt' {{/moshiCodeGen}} repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache index 4f97738c3d84..08c317ea6669 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache @@ -12,9 +12,9 @@ buildscript { ext.shadow_version = '2.0.3' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } maven { - url "https://plugins.gradle.org/m2/" + url = "https://plugins.gradle.org/m2/" } } dependencies { @@ -50,8 +50,8 @@ shadowJar { } repositories { - maven { url = "https://repo1.maven.org/maven2" } - maven { url "https://dl.bintray.com/kotlin/ktor" } + maven { url "https://repo1.maven.org/maven2" } + maven { url "https://dl.bintray.com/kotlin/ktor" } maven { url "https://dl.bintray.com/kotlin/kotlinx" } } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index 734c490caba0..2182d7362d0e 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -108,7 +108,8 @@ class {{classname}}(object): ) kwargs['_host_index'] = kwargs.get('_host_index', 0) {{#requiredParams}} - kwargs['{{paramName}}'] = {{paramName}} + kwargs['{{paramName}}'] = \ + {{paramName}} {{/requiredParams}} return self.call_with_http_info(**kwargs) @@ -216,7 +217,8 @@ class {{classname}}(object): }, 'openapi_types': { {{#allParams}} - '{{paramName}}': ({{{dataType}}},), + '{{paramName}}': + ({{{dataType}}},), {{/allParams}} }, 'attribute_map': { diff --git a/modules/openapi-generator/src/main/resources/r/description.mustache b/modules/openapi-generator/src/main/resources/r/description.mustache index 129c6fc828e2..3bd9db79ee41 100644 --- a/modules/openapi-generator/src/main/resources/r/description.mustache +++ b/modules/openapi-generator/src/main/resources/r/description.mustache @@ -3,6 +3,8 @@ Title: R Package Client for {{{appName}}} Version: {{packageVersion}} Authors@R: person("{{#infoName}}{{infoName}}{{/infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", email = "{{#infoEmail}}{{infoEmail}}{{/infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", role = c("aut", "cre")) Description: {{{appDescription}}}{{^appDescription}}R Package Client for {{{appName}}}{{/appDescription}} +URL: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}} +BugReports: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/issues Depends: R (>= 3.3) Encoding: UTF-8 License: {{#licenseInfo}}{{licenseInfo}}{{/licenseInfo}}{{^licenseInfo}}Unlicense{{/licenseInfo}} diff --git a/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle b/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle index d4862902bcd4..a9a3eb68dadf 100644 --- a/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle +++ b/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle @@ -3,7 +3,7 @@ plugins { } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { diff --git a/modules/openapi-generator/src/main/resources/scala-httpclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/scala-httpclient/build.gradle.mustache index 32e77db6231f..f65046daa62a 100644 --- a/modules/openapi-generator/src/main/resources/scala-httpclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/scala-httpclient/build.gradle.mustache @@ -109,7 +109,7 @@ ext { repositories { mavenLocal() - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 675d55a4fa61..9b5389031e90 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -348,7 +348,7 @@ private var managerStore = SynchronizedDictionary() observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ private var urlSessionStore = SynchronizedDictionary() case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 3f625aca23de..dc839d57cf7b 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -115,7 +115,9 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{^isListContainer}} if ({{paramName}} !== undefined) { {{#isDateTime}} - localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any instanceof Date) ? + ({{paramName}} as any).toISOString() : + {{paramName}}; {{/isDateTime}} {{^isDateTime}} {{#isDate}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java index 4ccac1f074f0..7776cf9ccf5e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java @@ -162,11 +162,11 @@ public void simpleModelWithTimeMachineTest() { final CodegenProperty property4 = cm.vars.get(3); Assert.assertEquals(property4.baseName, "birthDate"); - Assert.assertEquals(property4.complexType, "LocalDate"); - Assert.assertEquals(property4.dataType, "LocalDate"); + Assert.assertEquals(property4.complexType, "OffsetDate"); + Assert.assertEquals(property4.dataType, "OffsetDate"); Assert.assertEquals(property4.name, "birthDate"); Assert.assertEquals(property4.defaultValue, "null"); - Assert.assertEquals(property4.baseType, "LocalDate"); + Assert.assertEquals(property4.baseType, "OffsetDate"); Assert.assertFalse(property4.hasMore); Assert.assertFalse(property4.required); Assert.assertFalse(property4.isContainer); diff --git a/pom.xml b/pom.xml index e01e715039a5..64d0efc5fbee 100644 --- a/pom.xml +++ b/pom.xml @@ -1060,6 +1060,7 @@ samples/client/petstore/python-asyncio samples/client/petstore/python-tornado samples/openapi3/client/petstore/python + samples/openapi3/client/petstore/python-experimental samples/client/petstore/typescript-fetch/builds/default samples/client/petstore/typescript-fetch/builds/es6-target samples/client/petstore/typescript-fetch/builds/with-npm-version diff --git a/samples/client/petstore/R/DESCRIPTION b/samples/client/petstore/R/DESCRIPTION index 3f8ad4574874..481820f8457c 100644 --- a/samples/client/petstore/R/DESCRIPTION +++ b/samples/client/petstore/R/DESCRIPTION @@ -3,6 +3,8 @@ Title: R Package Client for OpenAPI Petstore Version: 1.0.0 Authors@R: person("OpenAPI Generator community", email = "team@openapitools.org", role = c("aut", "cre")) Description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +URL: https://github.com/GIT_USER_ID/GIT_REPO_ID +BugReports: https://github.com/GIT_USER_ID/GIT_REPO_ID/issues Depends: R (>= 3.3) Encoding: UTF-8 License: Apache-2.0 diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index e4955748d3e7..58592f031f65 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp index 30f1c04800ca..27152077769f 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp @@ -103,6 +103,10 @@ void PFXHttpRequestWorker::setWorkingDirectory(const QString &path) { } } +void PFXHttpRequestWorker::setCompressionEnabled(bool enable) { + isCompressionEnabled = enable; +} + QString PFXHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; @@ -311,6 +315,10 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); } + if(isCompressionEnabled){ + request.setRawHeader("Accept-Encoding", "deflate, gzip"); + } + if (input->http_method == "GET") { reply = manager->get(request); } else if (input->http_method == "POST") { @@ -340,15 +348,14 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { void PFXHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { error_type = reply->error(); - response = reply->readAll(); error_str = reply->errorString(); if (reply->rawHeaderPairs().count() > 0) { for (const auto &item : reply->rawHeaderPairs()) { headers.insert(item.first, item.second); } } + process_response(reply); reply->deleteLater(); - process_form_response(); emit on_execution_finished(this); } @@ -362,7 +369,7 @@ void PFXHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { emit on_execution_finished(this); } -void PFXHttpRequestWorker::process_form_response() { +void PFXHttpRequestWorker::process_response(QNetworkReply *reply) { if (getResponseHeaders().contains(QString("Content-Disposition"))) { auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts); auto contentType = @@ -376,18 +383,37 @@ void PFXHttpRequestWorker::process_form_response() { } } PFXHttpFileElement felement; - felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); + felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, reply->readAll()); files.insert(filename, felement); } } else if (getResponseHeaders().contains(QString("Content-Type"))) { auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts); if ((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))) { + // TODO : Handle Multipart responses } else { + if(headers.contains("Content-Encoding")){ + auto encoding = headers.value("Content-Encoding").split(QString(";"), QString::SkipEmptyParts); + if(encoding.count() > 0){ + auto compressionTypes = encoding.first().split(',', QString::SkipEmptyParts); + if(compressionTypes.contains("gzip", Qt::CaseInsensitive) || compressionTypes.contains("deflate", Qt::CaseInsensitive)){ + response = decompress(reply->readAll()); + } + } + } + else { + response = reply->readAll(); + } } } } +QByteArray PFXHttpRequestWorker::decompress(const QByteArray& data){ + QByteArray result; + bool sts = false; + return sts ? result : QByteArray(); +} + QSslConfiguration *PFXHttpRequestWorker::sslDefaultConfiguration; } // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h index 6b354142d283..c7f4c2a7f0b6 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h @@ -71,6 +71,7 @@ class PFXHttpRequestWorker : public QObject { void setWorkingDirectory(const QString &path); PFXHttpFileElement getHttpFileElement(const QString &fieldname = QString()); QByteArray *getMultiPartField(const QString &fieldname = QString()); + void setCompressionEnabled(bool enable); signals: void on_execution_finished(PFXHttpRequestWorker *worker); @@ -81,8 +82,10 @@ class PFXHttpRequestWorker : public QObject { QMap multiPartFields; QString workingDirectory; int _timeOut; + bool isCompressionEnabled; void on_manager_timeout(QNetworkReply *reply); - void process_form_response(); + void process_response(QNetworkReply *reply); + QByteArray decompress(const QByteArray& data); private slots: void on_manager_finished(QNetworkReply *reply); }; diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp index 9ac2f6264581..9230379520c5 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp @@ -22,7 +22,8 @@ PFXPetApi::PFXPetApi(const QString &scheme, const QString &host, int port, const _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} PFXPetApi::~PFXPetApi() { } @@ -55,6 +56,10 @@ void PFXPetApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void PFXPetApi::enableContentCompression() { + _compress = true; +} + void PFXPetApi::addPet(const PFXPet &body) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -66,6 +71,7 @@ void PFXPetApi::addPet(const PFXPet &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -87,6 +93,7 @@ void PFXPetApi::addPetCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -113,6 +120,7 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const QString &api_key) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); if (api_key != nullptr) { @@ -135,6 +143,7 @@ void PFXPetApi::deletePetCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -196,6 +205,7 @@ void PFXPetApi::findPetsByStatus(const QList &status) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -214,6 +224,7 @@ void PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QList output; QString json(worker->response); @@ -285,6 +296,7 @@ void PFXPetApi::findPetsByTags(const QList &tags) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -303,6 +315,7 @@ void PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QList output; QString json(worker->response); @@ -339,6 +352,7 @@ void PFXPetApi::getPetById(const qint64 &pet_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -357,6 +371,7 @@ void PFXPetApi::getPetByIdCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXPet output(QString(worker->response)); worker->deleteLater(); @@ -381,6 +396,7 @@ void PFXPetApi::updatePet(const PFXPet &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); @@ -402,6 +418,7 @@ void PFXPetApi::updatePetCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -428,6 +445,7 @@ void PFXPetApi::updatePetWithForm(const qint64 &pet_id, const QString &name, con PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); input.add_var("name", ::test_namespace::toStringValue(name)); @@ -448,6 +466,7 @@ void PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -474,6 +493,7 @@ void PFXPetApi::uploadFile(const qint64 &pet_id, const QString &additional_metad PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata)); @@ -494,6 +514,7 @@ void PFXPetApi::uploadFileCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXApiResponse output(QString(worker->response)); worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h index f55675845c14..7d2c00175c55 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h @@ -37,6 +37,7 @@ class PFXPetApi : public QObject { void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); void addPet(const PFXPet &body); void deletePet(const qint64 &pet_id, const QString &api_key); @@ -54,6 +55,7 @@ class PFXPetApi : public QObject { int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; void addPetCallback(PFXHttpRequestWorker *worker); void deletePetCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp index f16902079de6..05ee1622f0b7 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp @@ -22,7 +22,8 @@ PFXStoreApi::PFXStoreApi(const QString &scheme, const QString &host, int port, c _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} PFXStoreApi::~PFXStoreApi() { } @@ -55,6 +56,10 @@ void PFXStoreApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void PFXStoreApi::enableContentCompression() { + _compress = true; +} + void PFXStoreApi::deleteOrder(const QString &order_id) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -69,6 +74,7 @@ void PFXStoreApi::deleteOrder(const QString &order_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -87,6 +93,7 @@ void PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -110,6 +117,7 @@ void PFXStoreApi::getInventory() { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -128,6 +136,7 @@ void PFXStoreApi::getInventoryCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QMap output; QString json(worker->response); @@ -164,6 +173,7 @@ void PFXStoreApi::getOrderById(const qint64 &order_id) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -182,6 +192,7 @@ void PFXStoreApi::getOrderByIdCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXOrder output(QString(worker->response)); worker->deleteLater(); @@ -206,6 +217,7 @@ void PFXStoreApi::placeOrder(const PFXOrder &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -227,6 +239,7 @@ void PFXStoreApi::placeOrderCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXOrder output(QString(worker->response)); worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h index d0dec36dad0a..b61fc684b28c 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h @@ -36,6 +36,7 @@ class PFXStoreApi : public QObject { void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); void deleteOrder(const QString &order_id); void getInventory(); @@ -49,6 +50,7 @@ class PFXStoreApi : public QObject { int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; void deleteOrderCallback(PFXHttpRequestWorker *worker); void getInventoryCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp index b2d2b6aa2fee..44d8c2dee1f0 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp @@ -22,7 +22,8 @@ PFXUserApi::PFXUserApi(const QString &scheme, const QString &host, int port, con _host(host), _port(port), _basePath(basePath), - _timeOut(timeOut) {} + _timeOut(timeOut), + _compress(false) {} PFXUserApi::~PFXUserApi() { } @@ -55,6 +56,10 @@ void PFXUserApi::addHeaders(const QString &key, const QString &value) { defaultHeaders.insert(key, value); } +void PFXUserApi::enableContentCompression() { + _compress = true; +} + void PFXUserApi::createUser(const PFXUser &body) { QString fullPath = QString("%1://%2%3%4%5") .arg(_scheme) @@ -66,6 +71,7 @@ void PFXUserApi::createUser(const PFXUser &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QString output = body.asJson(); @@ -87,6 +93,7 @@ void PFXUserApi::createUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -110,6 +117,7 @@ void PFXUserApi::createUsersWithArrayInput(const QList &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); @@ -132,6 +140,7 @@ void PFXUserApi::createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker) msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -155,6 +164,7 @@ void PFXUserApi::createUsersWithListInput(const QList &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "POST"); QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); @@ -177,6 +187,7 @@ void PFXUserApi::createUsersWithListInputCallback(PFXHttpRequestWorker *worker) msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -203,6 +214,7 @@ void PFXUserApi::deleteUser(const QString &username) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "DELETE"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -221,6 +233,7 @@ void PFXUserApi::deleteUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -247,6 +260,7 @@ void PFXUserApi::getUserByName(const QString &username) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -265,6 +279,7 @@ void PFXUserApi::getUserByNameCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } PFXUser output(QString(worker->response)); worker->deleteLater(); @@ -301,6 +316,7 @@ void PFXUserApi::loginUser(const QString &username, const QString &password) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -319,6 +335,7 @@ void PFXUserApi::loginUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } QString output; ::test_namespace::fromStringValue(QString(worker->response), output); @@ -344,6 +361,7 @@ void PFXUserApi::logoutUser() { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "GET"); foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); } @@ -362,6 +380,7 @@ void PFXUserApi::logoutUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); @@ -388,6 +407,7 @@ void PFXUserApi::updateUser(const QString &username, const PFXUser &body) { PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); worker->setTimeOut(_timeOut); worker->setWorkingDirectory(_workingDirectory); + worker->setCompressionEnabled(_compress); PFXHttpRequestInput input(fullPath, "PUT"); QString output = body.asJson(); @@ -409,6 +429,7 @@ void PFXUserApi::updateUserCallback(PFXHttpRequestWorker *worker) { msg = QString("Success! %1 bytes").arg(worker->response.length()); } else { msg = "Error: " + worker->error_str; + error_str = QString("%1, %2").arg(worker->error_str).arg(QString(worker->response)); } worker->deleteLater(); diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h index 417c5a8d8792..4ca836a78958 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h +++ b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h @@ -36,6 +36,7 @@ class PFXUserApi : public QObject { void setTimeOut(const int timeOut); void setWorkingDirectory(const QString &path); void addHeaders(const QString &key, const QString &value); + void enableContentCompression(); void createUser(const PFXUser &body); void createUsersWithArrayInput(const QList &body); @@ -53,6 +54,7 @@ class PFXUserApi : public QObject { int _timeOut; QString _workingDirectory; QMap defaultHeaders; + bool _compress; void createUserCallback(PFXHttpRequestWorker *worker); void createUsersWithArrayInputCallback(PFXHttpRequestWorker *worker); diff --git a/samples/client/petstore/cpp-qt5/client/PFXclient.pri b/samples/client/petstore/cpp-qt5/client/PFXclient.pri index e86f90006a13..c09a32bdf4fa 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXclient.pri +++ b/samples/client/petstore/cpp-qt5/client/PFXclient.pri @@ -34,5 +34,5 @@ SOURCES += \ # Others $${PWD}/PFXHelpers.cpp \ $${PWD}/PFXHttpRequest.cpp \ - $${PWD}/PFXHttpFileElement.cpp + $${PWD}/PFXHttpFileElement.cpp diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 5b4ebc2f06ad..20e88d0d9b41 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -18,10 +18,15 @@ The version of the OpenAPI document: 1.0.0 Properties Org.OpenAPITools Org.OpenAPITools + A library generated from a OpenAPI doc {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} netstandard2.0 512 bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + https://github.com/GIT_USER_ID/GIT_REPO_ID + Minor update diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj index fbf4cc7af1ac..8d7243e6d1e0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -17,6 +17,9 @@ Org.OpenAPITools 1.0.0 bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml + https://github.com/GIT_USER_ID/GIT_REPO_ID.git + git + Minor update diff --git a/samples/client/petstore/dart-dio/lib/api.dart b/samples/client/petstore/dart-dio/lib/api.dart index 8fc03c1fec90..5206fb1d36ab 100644 --- a/samples/client/petstore/dart-dio/lib/api.dart +++ b/samples/client/petstore/dart-dio/lib/api.dart @@ -1,6 +1,5 @@ library openapi.api; -import 'package:http/io_client.dart'; import 'package:dio/dio.dart'; import 'package:built_value/serializer.dart'; import 'package:openapi/serializers.dart'; diff --git a/samples/client/petstore/dart-dio/lib/api/pet_api.dart b/samples/client/petstore/dart-dio/lib/api/pet_api.dart index 7078df59692a..5c78e6e6204c 100644 --- a/samples/client/petstore/dart-dio/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/pet_api.dart @@ -21,7 +21,7 @@ class PetApi { /// FutureaddPet(Pet body,{ CancelToken cancelToken, Map headers,}) async { - String path = "/pet"; + String _path = "/pet"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -38,7 +38,7 @@ class PetApi { bodyData = jsonbody; return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -54,13 +54,13 @@ class PetApi { /// FuturedeletePet(int petId,{ String apiKey,CancelToken cancelToken, Map headers,}) async { - String path = "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); + String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - headerParams["api_key"] = apiKey; + headerParams[r'api_key'] = apiKey; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); @@ -69,7 +69,7 @@ class PetApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -85,13 +85,13 @@ class PetApi { /// Multiple status values can be provided with comma separated strings Future>>findPetsByStatus(List status,{ CancelToken cancelToken, Map headers,}) async { - String path = "/pet/findByStatus"; + String _path = "/pet/findByStatus"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams["status"] = status; + queryParams[r'status'] = status; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); @@ -100,7 +100,7 @@ class PetApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -131,13 +131,13 @@ class PetApi { /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. Future>>findPetsByTags(List tags,{ CancelToken cancelToken, Map headers,}) async { - String path = "/pet/findByTags"; + String _path = "/pet/findByTags"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams["tags"] = tags; + queryParams[r'tags'] = tags; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); @@ -146,7 +146,7 @@ class PetApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -177,7 +177,7 @@ class PetApi { /// Returns a single pet Future>getPetById(int petId,{ CancelToken cancelToken, Map headers,}) async { - String path = "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); + String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -191,7 +191,7 @@ class PetApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -221,7 +221,7 @@ class PetApi { /// FutureupdatePet(Pet body,{ CancelToken cancelToken, Map headers,}) async { - String path = "/pet"; + String _path = "/pet"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -238,7 +238,7 @@ class PetApi { bodyData = jsonbody; return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -254,7 +254,7 @@ class PetApi { /// FutureupdatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map headers,}) async { - String path = "/pet/{petId}".replaceAll("{" + "petId" + "}", petId.toString()); + String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -270,7 +270,7 @@ class PetApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -286,7 +286,7 @@ class PetApi { /// Future>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map headers,}) async { - String path = "/pet/{petId}/uploadImage".replaceAll("{" + "petId" + "}", petId.toString()); + String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -299,16 +299,16 @@ class PetApi { Map formData = {}; if (additionalMetadata != null) { - formData['additionalMetadata'] = parameterToString(_serializers, additionalMetadata); + formData[r'additionalMetadata'] = parameterToString(_serializers, additionalMetadata); } if (file != null) { - formData['file'] = MultipartFile.fromBytes(file, filename: "file"); + formData[r'file'] = MultipartFile.fromBytes(file, filename: r'file'); } bodyData = FormData.fromMap(formData); return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( diff --git a/samples/client/petstore/dart-dio/lib/api/store_api.dart b/samples/client/petstore/dart-dio/lib/api/store_api.dart index abbe73be27c2..92e4a1394fd1 100644 --- a/samples/client/petstore/dart-dio/lib/api/store_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/store_api.dart @@ -18,7 +18,7 @@ class StoreApi { /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors FuturedeleteOrder(String orderId,{ CancelToken cancelToken, Map headers,}) async { - String path = "/store/order/{orderId}".replaceAll("{" + "orderId" + "}", orderId.toString()); + String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -32,7 +32,7 @@ class StoreApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -48,7 +48,7 @@ class StoreApi { /// Returns a map of status codes to quantities Future>>getInventory({ CancelToken cancelToken, Map headers,}) async { - String path = "/store/inventory"; + String _path = "/store/inventory"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -62,7 +62,7 @@ class StoreApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -92,7 +92,7 @@ class StoreApi { /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions Future>getOrderById(int orderId,{ CancelToken cancelToken, Map headers,}) async { - String path = "/store/order/{orderId}".replaceAll("{" + "orderId" + "}", orderId.toString()); + String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -106,7 +106,7 @@ class StoreApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -136,7 +136,7 @@ class StoreApi { /// Future>placeOrder(Order body,{ CancelToken cancelToken, Map headers,}) async { - String path = "/store/order"; + String _path = "/store/order"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -153,7 +153,7 @@ class StoreApi { bodyData = jsonbody; return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( diff --git a/samples/client/petstore/dart-dio/lib/api/user_api.dart b/samples/client/petstore/dart-dio/lib/api/user_api.dart index a2d2d3189a32..2e127ec8d7e1 100644 --- a/samples/client/petstore/dart-dio/lib/api/user_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/user_api.dart @@ -18,7 +18,7 @@ class UserApi { /// This can only be done by the logged in user. FuturecreateUser(User body,{ CancelToken cancelToken, Map headers,}) async { - String path = "/user"; + String _path = "/user"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -35,7 +35,7 @@ class UserApi { bodyData = jsonbody; return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -51,7 +51,7 @@ class UserApi { /// FuturecreateUsersWithArrayInput(List body,{ CancelToken cancelToken, Map headers,}) async { - String path = "/user/createWithArray"; + String _path = "/user/createWithArray"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -69,7 +69,7 @@ class UserApi { bodyData = jsonbody; return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -85,7 +85,7 @@ class UserApi { /// FuturecreateUsersWithListInput(List body,{ CancelToken cancelToken, Map headers,}) async { - String path = "/user/createWithList"; + String _path = "/user/createWithList"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -103,7 +103,7 @@ class UserApi { bodyData = jsonbody; return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -119,7 +119,7 @@ class UserApi { /// This can only be done by the logged in user. FuturedeleteUser(String username,{ CancelToken cancelToken, Map headers,}) async { - String path = "/user/{username}".replaceAll("{" + "username" + "}", username.toString()); + String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -133,7 +133,7 @@ class UserApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -149,7 +149,7 @@ class UserApi { /// Future>getUserByName(String username,{ CancelToken cancelToken, Map headers,}) async { - String path = "/user/{username}".replaceAll("{" + "username" + "}", username.toString()); + String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -163,7 +163,7 @@ class UserApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -193,14 +193,14 @@ class UserApi { /// Future>loginUser(String username,String password,{ CancelToken cancelToken, Map headers,}) async { - String path = "/user/login"; + String _path = "/user/login"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); dynamic bodyData; - queryParams["username"] = username; - queryParams["password"] = password; + queryParams[r'username'] = username; + queryParams[r'password'] = password; queryParams.removeWhere((key, value) => value == null); headerParams.removeWhere((key, value) => value == null); @@ -209,7 +209,7 @@ class UserApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -239,7 +239,7 @@ class UserApi { /// FuturelogoutUser({ CancelToken cancelToken, Map headers,}) async { - String path = "/user/logout"; + String _path = "/user/logout"; Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -253,7 +253,7 @@ class UserApi { return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( @@ -269,7 +269,7 @@ class UserApi { /// This can only be done by the logged in user. FutureupdateUser(String username,User body,{ CancelToken cancelToken, Map headers,}) async { - String path = "/user/{username}".replaceAll("{" + "username" + "}", username.toString()); + String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); Map queryParams = {}; Map headerParams = Map.from(headers ?? {}); @@ -286,7 +286,7 @@ class UserApi { bodyData = jsonbody; return _dio.request( - path, + _path, queryParameters: queryParams, data: bodyData, options: Options( diff --git a/samples/client/petstore/dart-dio/lib/model/api_response.dart b/samples/client/petstore/dart-dio/lib/model/api_response.dart index 1463d222b91e..1512a5509db4 100644 --- a/samples/client/petstore/dart-dio/lib/model/api_response.dart +++ b/samples/client/petstore/dart-dio/lib/model/api_response.dart @@ -7,15 +7,15 @@ abstract class ApiResponse implements Built { @nullable - @BuiltValueField(wireName: 'code') + @BuiltValueField(wireName: r'code') int get code; @nullable - @BuiltValueField(wireName: 'type') + @BuiltValueField(wireName: r'type') String get type; @nullable - @BuiltValueField(wireName: 'message') + @BuiltValueField(wireName: r'message') String get message; // Boilerplate code needed to wire-up generated code diff --git a/samples/client/petstore/dart-dio/lib/model/api_response.g.dart b/samples/client/petstore/dart-dio/lib/model/api_response.g.dart index ca7c7161ba8a..3e5db8c18155 100644 --- a/samples/client/petstore/dart-dio/lib/model/api_response.g.dart +++ b/samples/client/petstore/dart-dio/lib/model/api_response.g.dart @@ -17,16 +17,25 @@ class _$ApiResponseSerializer implements StructuredSerializer { @override Iterable serialize(Serializers serializers, ApiResponse object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'code', - serializers.serialize(object.code, specifiedType: const FullType(int)), - 'type', - serializers.serialize(object.type, specifiedType: const FullType(String)), - 'message', - serializers.serialize(object.message, - specifiedType: const FullType(String)), - ]; - + final result = []; + if (object.code != null) { + result + ..add('code') + ..add(serializers.serialize(object.code, + specifiedType: const FullType(int))); + } + if (object.type != null) { + result + ..add('type') + ..add(serializers.serialize(object.type, + specifiedType: const FullType(String))); + } + if (object.message != null) { + result + ..add('message') + ..add(serializers.serialize(object.message, + specifiedType: const FullType(String))); + } return result; } @@ -71,17 +80,7 @@ class _$ApiResponse extends ApiResponse { factory _$ApiResponse([void Function(ApiResponseBuilder) updates]) => (new ApiResponseBuilder()..update(updates)).build(); - _$ApiResponse._({this.code, this.type, this.message}) : super._() { - if (code == null) { - throw new BuiltValueNullFieldError('ApiResponse', 'code'); - } - if (type == null) { - throw new BuiltValueNullFieldError('ApiResponse', 'type'); - } - if (message == null) { - throw new BuiltValueNullFieldError('ApiResponse', 'message'); - } - } + _$ApiResponse._({this.code, this.type, this.message}) : super._(); @override ApiResponse rebuild(void Function(ApiResponseBuilder) updates) => diff --git a/samples/client/petstore/dart-dio/lib/model/category.dart b/samples/client/petstore/dart-dio/lib/model/category.dart index 725c0a5c618f..da7b671dd2ac 100644 --- a/samples/client/petstore/dart-dio/lib/model/category.dart +++ b/samples/client/petstore/dart-dio/lib/model/category.dart @@ -7,11 +7,11 @@ abstract class Category implements Built { @nullable - @BuiltValueField(wireName: 'id') + @BuiltValueField(wireName: r'id') int get id; @nullable - @BuiltValueField(wireName: 'name') + @BuiltValueField(wireName: r'name') String get name; // Boilerplate code needed to wire-up generated code diff --git a/samples/client/petstore/dart-dio/lib/model/category.g.dart b/samples/client/petstore/dart-dio/lib/model/category.g.dart index 4e4b83a0060d..a766a9b3db6f 100644 --- a/samples/client/petstore/dart-dio/lib/model/category.g.dart +++ b/samples/client/petstore/dart-dio/lib/model/category.g.dart @@ -17,13 +17,19 @@ class _$CategorySerializer implements StructuredSerializer { @override Iterable serialize(Serializers serializers, Category object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'id', - serializers.serialize(object.id, specifiedType: const FullType(int)), - 'name', - serializers.serialize(object.name, specifiedType: const FullType(String)), - ]; - + final result = []; + if (object.id != null) { + result + ..add('id') + ..add(serializers.serialize(object.id, + specifiedType: const FullType(int))); + } + if (object.name != null) { + result + ..add('name') + ..add(serializers.serialize(object.name, + specifiedType: const FullType(String))); + } return result; } @@ -62,14 +68,7 @@ class _$Category extends Category { factory _$Category([void Function(CategoryBuilder) updates]) => (new CategoryBuilder()..update(updates)).build(); - _$Category._({this.id, this.name}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('Category', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError('Category', 'name'); - } - } + _$Category._({this.id, this.name}) : super._(); @override Category rebuild(void Function(CategoryBuilder) updates) => diff --git a/samples/client/petstore/dart-dio/lib/model/order.dart b/samples/client/petstore/dart-dio/lib/model/order.dart index 4838d56a1d7b..abf27c59f973 100644 --- a/samples/client/petstore/dart-dio/lib/model/order.dart +++ b/samples/client/petstore/dart-dio/lib/model/order.dart @@ -7,28 +7,28 @@ abstract class Order implements Built { @nullable - @BuiltValueField(wireName: 'id') + @BuiltValueField(wireName: r'id') int get id; @nullable - @BuiltValueField(wireName: 'petId') + @BuiltValueField(wireName: r'petId') int get petId; @nullable - @BuiltValueField(wireName: 'quantity') + @BuiltValueField(wireName: r'quantity') int get quantity; @nullable - @BuiltValueField(wireName: 'shipDate') + @BuiltValueField(wireName: r'shipDate') DateTime get shipDate; /* Order Status */ @nullable - @BuiltValueField(wireName: 'status') + @BuiltValueField(wireName: r'status') String get status; //enum statusEnum { placed, approved, delivered, }; @nullable - @BuiltValueField(wireName: 'complete') + @BuiltValueField(wireName: r'complete') bool get complete; // Boilerplate code needed to wire-up generated code diff --git a/samples/client/petstore/dart-dio/lib/model/order.g.dart b/samples/client/petstore/dart-dio/lib/model/order.g.dart index e4eede934c30..5d58a6b36c1d 100644 --- a/samples/client/petstore/dart-dio/lib/model/order.g.dart +++ b/samples/client/petstore/dart-dio/lib/model/order.g.dart @@ -17,25 +17,43 @@ class _$OrderSerializer implements StructuredSerializer { @override Iterable serialize(Serializers serializers, Order object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'id', - serializers.serialize(object.id, specifiedType: const FullType(int)), - 'petId', - serializers.serialize(object.petId, specifiedType: const FullType(int)), - 'quantity', - serializers.serialize(object.quantity, - specifiedType: const FullType(int)), - 'shipDate', - serializers.serialize(object.shipDate, - specifiedType: const FullType(DateTime)), - 'status', - serializers.serialize(object.status, - specifiedType: const FullType(String)), - 'complete', - serializers.serialize(object.complete, - specifiedType: const FullType(bool)), - ]; - + final result = []; + if (object.id != null) { + result + ..add('id') + ..add(serializers.serialize(object.id, + specifiedType: const FullType(int))); + } + if (object.petId != null) { + result + ..add('petId') + ..add(serializers.serialize(object.petId, + specifiedType: const FullType(int))); + } + if (object.quantity != null) { + result + ..add('quantity') + ..add(serializers.serialize(object.quantity, + specifiedType: const FullType(int))); + } + if (object.shipDate != null) { + result + ..add('shipDate') + ..add(serializers.serialize(object.shipDate, + specifiedType: const FullType(DateTime))); + } + if (object.status != null) { + result + ..add('status') + ..add(serializers.serialize(object.status, + specifiedType: const FullType(String))); + } + if (object.complete != null) { + result + ..add('complete') + ..add(serializers.serialize(object.complete, + specifiedType: const FullType(bool))); + } return result; } @@ -105,26 +123,7 @@ class _$Order extends Order { this.shipDate, this.status, this.complete}) - : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('Order', 'id'); - } - if (petId == null) { - throw new BuiltValueNullFieldError('Order', 'petId'); - } - if (quantity == null) { - throw new BuiltValueNullFieldError('Order', 'quantity'); - } - if (shipDate == null) { - throw new BuiltValueNullFieldError('Order', 'shipDate'); - } - if (status == null) { - throw new BuiltValueNullFieldError('Order', 'status'); - } - if (complete == null) { - throw new BuiltValueNullFieldError('Order', 'complete'); - } - } + : super._(); @override Order rebuild(void Function(OrderBuilder) updates) => diff --git a/samples/client/petstore/dart-dio/lib/model/pet.dart b/samples/client/petstore/dart-dio/lib/model/pet.dart index e8810fa2e9c3..d8647038aedb 100644 --- a/samples/client/petstore/dart-dio/lib/model/pet.dart +++ b/samples/client/petstore/dart-dio/lib/model/pet.dart @@ -10,27 +10,27 @@ abstract class Pet implements Built { @nullable - @BuiltValueField(wireName: 'id') + @BuiltValueField(wireName: r'id') int get id; @nullable - @BuiltValueField(wireName: 'category') + @BuiltValueField(wireName: r'category') Category get category; @nullable - @BuiltValueField(wireName: 'name') + @BuiltValueField(wireName: r'name') String get name; @nullable - @BuiltValueField(wireName: 'photoUrls') + @BuiltValueField(wireName: r'photoUrls') BuiltList get photoUrls; @nullable - @BuiltValueField(wireName: 'tags') + @BuiltValueField(wireName: r'tags') BuiltList get tags; /* pet status in the store */ @nullable - @BuiltValueField(wireName: 'status') + @BuiltValueField(wireName: r'status') String get status; //enum statusEnum { available, pending, sold, }; diff --git a/samples/client/petstore/dart-dio/lib/model/pet.g.dart b/samples/client/petstore/dart-dio/lib/model/pet.g.dart index 058ad2dc9b14..abfeb806b47b 100644 --- a/samples/client/petstore/dart-dio/lib/model/pet.g.dart +++ b/samples/client/petstore/dart-dio/lib/model/pet.g.dart @@ -17,25 +17,45 @@ class _$PetSerializer implements StructuredSerializer { @override Iterable serialize(Serializers serializers, Pet object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'id', - serializers.serialize(object.id, specifiedType: const FullType(int)), - 'category', - serializers.serialize(object.category, - specifiedType: const FullType(Category)), - 'name', - serializers.serialize(object.name, specifiedType: const FullType(String)), - 'photoUrls', - serializers.serialize(object.photoUrls, - specifiedType: const FullType(List, const [const FullType(String)])), - 'tags', - serializers.serialize(object.tags, - specifiedType: const FullType(List, const [const FullType(Tag)])), - 'status', - serializers.serialize(object.status, - specifiedType: const FullType(String)), - ]; - + final result = []; + if (object.id != null) { + result + ..add('id') + ..add(serializers.serialize(object.id, + specifiedType: const FullType(int))); + } + if (object.category != null) { + result + ..add('category') + ..add(serializers.serialize(object.category, + specifiedType: const FullType(Category))); + } + if (object.name != null) { + result + ..add('name') + ..add(serializers.serialize(object.name, + specifiedType: const FullType(String))); + } + if (object.photoUrls != null) { + result + ..add('photoUrls') + ..add(serializers.serialize(object.photoUrls, + specifiedType: + const FullType(BuiltList, const [const FullType(String)]))); + } + if (object.tags != null) { + result + ..add('tags') + ..add(serializers.serialize(object.tags, + specifiedType: + const FullType(BuiltList, const [const FullType(Tag)]))); + } + if (object.status != null) { + result + ..add('status') + ..add(serializers.serialize(object.status, + specifiedType: const FullType(String))); + } return result; } @@ -63,16 +83,16 @@ class _$PetSerializer implements StructuredSerializer { specifiedType: const FullType(String)) as String; break; case 'photoUrls': - result.photoUrls = serializers.deserialize(value, + result.photoUrls.replace(serializers.deserialize(value, specifiedType: - const FullType(List, const [const FullType(String)])) - as List; + const FullType(BuiltList, const [const FullType(String)])) + as BuiltList); break; case 'tags': - result.tags = serializers.deserialize(value, + result.tags.replace(serializers.deserialize(value, specifiedType: - const FullType(List, const [const FullType(Tag)])) - as List; + const FullType(BuiltList, const [const FullType(Tag)])) + as BuiltList); break; case 'status': result.status = serializers.deserialize(value, @@ -93,9 +113,9 @@ class _$Pet extends Pet { @override final String name; @override - final List photoUrls; + final BuiltList photoUrls; @override - final List tags; + final BuiltList tags; @override final String status; @@ -109,26 +129,7 @@ class _$Pet extends Pet { this.photoUrls, this.tags, this.status}) - : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('Pet', 'id'); - } - if (category == null) { - throw new BuiltValueNullFieldError('Pet', 'category'); - } - if (name == null) { - throw new BuiltValueNullFieldError('Pet', 'name'); - } - if (photoUrls == null) { - throw new BuiltValueNullFieldError('Pet', 'photoUrls'); - } - if (tags == null) { - throw new BuiltValueNullFieldError('Pet', 'tags'); - } - if (status == null) { - throw new BuiltValueNullFieldError('Pet', 'status'); - } - } + : super._(); @override Pet rebuild(void Function(PetBuilder) updates) => @@ -187,13 +188,14 @@ class PetBuilder implements Builder { String get name => _$this._name; set name(String name) => _$this._name = name; - List _photoUrls; - List get photoUrls => _$this._photoUrls; - set photoUrls(List photoUrls) => _$this._photoUrls = photoUrls; + ListBuilder _photoUrls; + ListBuilder get photoUrls => + _$this._photoUrls ??= new ListBuilder(); + set photoUrls(ListBuilder photoUrls) => _$this._photoUrls = photoUrls; - List _tags; - List get tags => _$this._tags; - set tags(List tags) => _$this._tags = tags; + ListBuilder _tags; + ListBuilder get tags => _$this._tags ??= new ListBuilder(); + set tags(ListBuilder tags) => _$this._tags = tags; String _status; String get status => _$this._status; @@ -206,8 +208,8 @@ class PetBuilder implements Builder { _id = _$v.id; _category = _$v.category?.toBuilder(); _name = _$v.name; - _photoUrls = _$v.photoUrls; - _tags = _$v.tags; + _photoUrls = _$v.photoUrls?.toBuilder(); + _tags = _$v.tags?.toBuilder(); _status = _$v.status; _$v = null; } @@ -234,16 +236,21 @@ class PetBuilder implements Builder { _$result = _$v ?? new _$Pet._( id: id, - category: category.build(), + category: _category?.build(), name: name, - photoUrls: photoUrls, - tags: tags, + photoUrls: _photoUrls?.build(), + tags: _tags?.build(), status: status); } catch (_) { String _$failedField; try { _$failedField = 'category'; - category.build(); + _category?.build(); + + _$failedField = 'photoUrls'; + _photoUrls?.build(); + _$failedField = 'tags'; + _tags?.build(); } catch (e) { throw new BuiltValueNestedFieldError( 'Pet', _$failedField, e.toString()); diff --git a/samples/client/petstore/dart-dio/lib/model/tag.dart b/samples/client/petstore/dart-dio/lib/model/tag.dart index ba86002670e3..202a58ee976b 100644 --- a/samples/client/petstore/dart-dio/lib/model/tag.dart +++ b/samples/client/petstore/dart-dio/lib/model/tag.dart @@ -7,11 +7,11 @@ abstract class Tag implements Built { @nullable - @BuiltValueField(wireName: 'id') + @BuiltValueField(wireName: r'id') int get id; @nullable - @BuiltValueField(wireName: 'name') + @BuiltValueField(wireName: r'name') String get name; // Boilerplate code needed to wire-up generated code diff --git a/samples/client/petstore/dart-dio/lib/model/tag.g.dart b/samples/client/petstore/dart-dio/lib/model/tag.g.dart index e7de1eab62c9..4c8f7a9dc880 100644 --- a/samples/client/petstore/dart-dio/lib/model/tag.g.dart +++ b/samples/client/petstore/dart-dio/lib/model/tag.g.dart @@ -17,13 +17,19 @@ class _$TagSerializer implements StructuredSerializer { @override Iterable serialize(Serializers serializers, Tag object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'id', - serializers.serialize(object.id, specifiedType: const FullType(int)), - 'name', - serializers.serialize(object.name, specifiedType: const FullType(String)), - ]; - + final result = []; + if (object.id != null) { + result + ..add('id') + ..add(serializers.serialize(object.id, + specifiedType: const FullType(int))); + } + if (object.name != null) { + result + ..add('name') + ..add(serializers.serialize(object.name, + specifiedType: const FullType(String))); + } return result; } @@ -62,14 +68,7 @@ class _$Tag extends Tag { factory _$Tag([void Function(TagBuilder) updates]) => (new TagBuilder()..update(updates)).build(); - _$Tag._({this.id, this.name}) : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('Tag', 'id'); - } - if (name == null) { - throw new BuiltValueNullFieldError('Tag', 'name'); - } - } + _$Tag._({this.id, this.name}) : super._(); @override Tag rebuild(void Function(TagBuilder) updates) => diff --git a/samples/client/petstore/dart-dio/lib/model/user.dart b/samples/client/petstore/dart-dio/lib/model/user.dart index d6595d4a9d84..3b70e58fac05 100644 --- a/samples/client/petstore/dart-dio/lib/model/user.dart +++ b/samples/client/petstore/dart-dio/lib/model/user.dart @@ -7,35 +7,35 @@ abstract class User implements Built { @nullable - @BuiltValueField(wireName: 'id') + @BuiltValueField(wireName: r'id') int get id; @nullable - @BuiltValueField(wireName: 'username') + @BuiltValueField(wireName: r'username') String get username; @nullable - @BuiltValueField(wireName: 'firstName') + @BuiltValueField(wireName: r'firstName') String get firstName; @nullable - @BuiltValueField(wireName: 'lastName') + @BuiltValueField(wireName: r'lastName') String get lastName; @nullable - @BuiltValueField(wireName: 'email') + @BuiltValueField(wireName: r'email') String get email; @nullable - @BuiltValueField(wireName: 'password') + @BuiltValueField(wireName: r'password') String get password; @nullable - @BuiltValueField(wireName: 'phone') + @BuiltValueField(wireName: r'phone') String get phone; /* User Status */ @nullable - @BuiltValueField(wireName: 'userStatus') + @BuiltValueField(wireName: r'userStatus') int get userStatus; // Boilerplate code needed to wire-up generated code diff --git a/samples/client/petstore/dart-dio/lib/model/user.g.dart b/samples/client/petstore/dart-dio/lib/model/user.g.dart index 2b277e1d49c2..5a04b4804cd2 100644 --- a/samples/client/petstore/dart-dio/lib/model/user.g.dart +++ b/samples/client/petstore/dart-dio/lib/model/user.g.dart @@ -17,32 +17,55 @@ class _$UserSerializer implements StructuredSerializer { @override Iterable serialize(Serializers serializers, User object, {FullType specifiedType = FullType.unspecified}) { - final result = [ - 'id', - serializers.serialize(object.id, specifiedType: const FullType(int)), - 'username', - serializers.serialize(object.username, - specifiedType: const FullType(String)), - 'firstName', - serializers.serialize(object.firstName, - specifiedType: const FullType(String)), - 'lastName', - serializers.serialize(object.lastName, - specifiedType: const FullType(String)), - 'email', - serializers.serialize(object.email, - specifiedType: const FullType(String)), - 'password', - serializers.serialize(object.password, - specifiedType: const FullType(String)), - 'phone', - serializers.serialize(object.phone, - specifiedType: const FullType(String)), - 'userStatus', - serializers.serialize(object.userStatus, - specifiedType: const FullType(int)), - ]; - + final result = []; + if (object.id != null) { + result + ..add('id') + ..add(serializers.serialize(object.id, + specifiedType: const FullType(int))); + } + if (object.username != null) { + result + ..add('username') + ..add(serializers.serialize(object.username, + specifiedType: const FullType(String))); + } + if (object.firstName != null) { + result + ..add('firstName') + ..add(serializers.serialize(object.firstName, + specifiedType: const FullType(String))); + } + if (object.lastName != null) { + result + ..add('lastName') + ..add(serializers.serialize(object.lastName, + specifiedType: const FullType(String))); + } + if (object.email != null) { + result + ..add('email') + ..add(serializers.serialize(object.email, + specifiedType: const FullType(String))); + } + if (object.password != null) { + result + ..add('password') + ..add(serializers.serialize(object.password, + specifiedType: const FullType(String))); + } + if (object.phone != null) { + result + ..add('phone') + ..add(serializers.serialize(object.phone, + specifiedType: const FullType(String))); + } + if (object.userStatus != null) { + result + ..add('userStatus') + ..add(serializers.serialize(object.userStatus, + specifiedType: const FullType(int))); + } return result; } @@ -126,32 +149,7 @@ class _$User extends User { this.password, this.phone, this.userStatus}) - : super._() { - if (id == null) { - throw new BuiltValueNullFieldError('User', 'id'); - } - if (username == null) { - throw new BuiltValueNullFieldError('User', 'username'); - } - if (firstName == null) { - throw new BuiltValueNullFieldError('User', 'firstName'); - } - if (lastName == null) { - throw new BuiltValueNullFieldError('User', 'lastName'); - } - if (email == null) { - throw new BuiltValueNullFieldError('User', 'email'); - } - if (password == null) { - throw new BuiltValueNullFieldError('User', 'password'); - } - if (phone == null) { - throw new BuiltValueNullFieldError('User', 'phone'); - } - if (userStatus == null) { - throw new BuiltValueNullFieldError('User', 'userStatus'); - } - } + : super._(); @override User rebuild(void Function(UserBuilder) updates) => diff --git a/samples/client/petstore/dart-dio/lib/serializers.g.dart b/samples/client/petstore/dart-dio/lib/serializers.g.dart index 8106577235d9..24717f2afb5a 100644 --- a/samples/client/petstore/dart-dio/lib/serializers.g.dart +++ b/samples/client/petstore/dart-dio/lib/serializers.g.dart @@ -12,7 +12,13 @@ Serializers _$serializers = (new Serializers().toBuilder() ..add(Order.serializer) ..add(Pet.serializer) ..add(Tag.serializer) - ..add(User.serializer)) + ..add(User.serializer) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(String)]), + () => new ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(Tag)]), + () => new ListBuilder())) .build(); // ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new 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 0a9b9b5f7439..6a39cfa04ce1 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api_fake.go +++ b/samples/client/petstore/go-experimental/go-petstore/api_fake.go @@ -1757,14 +1757,16 @@ func (r apiTestQueryParameterCollectionFormatRequest) Execute() (*_nethttp.Respo localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv")) localVarQueryParams.Add("http", parameterToString(*r.http, "space")) localVarQueryParams.Add("url", parameterToString(*r.url, "csv")) - t := *r.context - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + { + t := *r.context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) } - } else { - localVarQueryParams.Add("context", parameterToString(t, "multi")) } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/samples/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index 9698f14c2ab2..a97fc77b8130 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -14,7 +14,7 @@ wrapper { buildscript { repositories { maven { url "https://repo1.maven.org/maven2" } - maven { url 'https://repo.jfrog.org/artifactory/gradle-plugins' } + maven { url = 'https://repo.jfrog.org/artifactory/gradle-plugins' } } dependencies { classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16') @@ -22,7 +22,7 @@ buildscript { } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } mavenLocal() } diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index fe911616a9ca..0429acb2f2b9 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/feign10x/build.gradle b/samples/client/petstore/java/feign10x/build.gradle index 2947fa9fca9b..e859b17d6f99 100644 --- a/samples/client/petstore/java/feign10x/build.gradle +++ b/samples/client/petstore/java/feign10x/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index d708ed36873b..520cf4df273c 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index f443c5f9b0bd..e2d9463cf37c 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { @@ -16,7 +16,7 @@ buildscript { } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index dce5fd6f9f4c..75ba6b7c88d3 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/jersey2/build.gradle b/samples/client/petstore/java/jersey2/build.gradle index 7d37027e24fd..1f7b5409598e 100644 --- a/samples/client/petstore/java/jersey2/build.gradle +++ b/samples/client/petstore/java/jersey2/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index 3eb0149b872f..a790b04b52b9 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -6,13 +6,13 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 372a3e016961..39f391d1ca8c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -7,7 +7,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 1228e8e4746b..86d58b600385 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -7,7 +7,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index 926a6da124a5..67c6d784de84 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 8458f287098e..1155ae1cd21b 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 948c75cd2d01..ca80535884a3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index 3c4f5135550b..02d5b8477fac 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/retrofit/build.gradle b/samples/client/petstore/java/retrofit/build.gradle index 8adb1c97e406..606905649a1f 100644 --- a/samples/client/petstore/java/retrofit/build.gradle +++ b/samples/client/petstore/java/retrofit/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/retrofit2-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 0154e4ac5a1b..c40aba2faad6 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index 5ab96734c228..9bb38877b646 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index 150b921dc0c4..c09036515951 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index 8d6f396a7d62..3b1a970bd1e5 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/retrofit2rx/build.gradle b/samples/client/petstore/java/retrofit2rx/build.gradle index ec0b933d544a..5b8f85066e0c 100644 --- a/samples/client/petstore/java/retrofit2rx/build.gradle +++ b/samples/client/petstore/java/retrofit2rx/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index ece899b42a2a..dbb70bc02767 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index f0f0aa166ab4..d62c637c2440 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -5,7 +5,7 @@ group = 'org.openapitools' version = '1.0.0' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index 2b086c3761de..ef4781d09292 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -6,7 +6,7 @@ version = '1.0.0' buildscript { repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } dependencies { @@ -16,7 +16,7 @@ buildscript { } repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } jcenter() } diff --git a/samples/client/petstore/kotlin-gson/build.gradle b/samples/client/petstore/kotlin-gson/build.gradle index 95954baaf8cf..b47c93982424 100644 --- a/samples/client/petstore/kotlin-gson/build.gradle +++ b/samples/client/petstore/kotlin-gson/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-json-request-date/build.gradle b/samples/client/petstore/kotlin-json-request-date/build.gradle index f5b086056ff3..56be0bd0dd87 100644 --- a/samples/client/petstore/kotlin-json-request-date/build.gradle +++ b/samples/client/petstore/kotlin-json-request-date/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-moshi-codegen/build.gradle b/samples/client/petstore/kotlin-moshi-codegen/build.gradle index f887698882ec..3790ead27946 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/build.gradle +++ b/samples/client/petstore/kotlin-moshi-codegen/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -21,7 +21,7 @@ apply plugin: 'kotlin' apply plugin: 'kotlin-kapt' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-nonpublic/build.gradle b/samples/client/petstore/kotlin-nonpublic/build.gradle index f5b086056ff3..56be0bd0dd87 100644 --- a/samples/client/petstore/kotlin-nonpublic/build.gradle +++ b/samples/client/petstore/kotlin-nonpublic/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-nullable/build.gradle b/samples/client/petstore/kotlin-nullable/build.gradle index f5b086056ff3..56be0bd0dd87 100644 --- a/samples/client/petstore/kotlin-nullable/build.gradle +++ b/samples/client/petstore/kotlin-nullable/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-okhttp3/build.gradle b/samples/client/petstore/kotlin-okhttp3/build.gradle index 555fa1a75a76..662c2a62ce34 100644 --- a/samples/client/petstore/kotlin-okhttp3/build.gradle +++ b/samples/client/petstore/kotlin-okhttp3/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-retrofit2/build.gradle b/samples/client/petstore/kotlin-retrofit2/build.gradle index a333a51cb021..392d9a352e68 100644 --- a/samples/client/petstore/kotlin-retrofit2/build.gradle +++ b/samples/client/petstore/kotlin-retrofit2/build.gradle @@ -11,7 +11,7 @@ buildscript { ext.retrofitVersion = '2.6.2' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -21,7 +21,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-string/build.gradle b/samples/client/petstore/kotlin-string/build.gradle index f5b086056ff3..56be0bd0dd87 100644 --- a/samples/client/petstore/kotlin-string/build.gradle +++ b/samples/client/petstore/kotlin-string/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin-threetenbp/build.gradle b/samples/client/petstore/kotlin-threetenbp/build.gradle index cf6de4c037ed..886101b0fbef 100644 --- a/samples/client/petstore/kotlin-threetenbp/build.gradle +++ b/samples/client/petstore/kotlin-threetenbp/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/kotlin/build.gradle b/samples/client/petstore/kotlin/build.gradle index f5b086056ff3..56be0bd0dd87 100644 --- a/samples/client/petstore/kotlin/build.gradle +++ b/samples/client/petstore/kotlin/build.gradle @@ -10,7 +10,7 @@ buildscript { ext.kotlin_version = '1.3.61' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } test { diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index c8e87491d52a..7a8e081050d1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -102,7 +102,8 @@ def __call_123_test_special_tags(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.call_123_test_special_tags = Endpoint( @@ -134,7 +135,8 @@ def __call_123_test_special_tags(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (client.Client,), + 'body': + (client.Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index be569e05cbd2..13b39417a25f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -108,7 +108,8 @@ def __create_xml_item(self, xml_item, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['xml_item'] = xml_item + kwargs['xml_item'] = \ + xml_item return self.call_with_http_info(**kwargs) self.create_xml_item = Endpoint( @@ -140,7 +141,8 @@ def __create_xml_item(self, xml_item, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'xml_item': (xml_item.XmlItem,), + 'xml_item': + (xml_item.XmlItem,), }, 'attribute_map': { }, @@ -247,7 +249,8 @@ def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (bool,), + 'body': + (bool,), }, 'attribute_map': { }, @@ -349,7 +352,8 @@ def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (outer_composite.OuterComposite,), + 'body': + (outer_composite.OuterComposite,), }, 'attribute_map': { }, @@ -451,7 +455,8 @@ def __fake_outer_enum_serialize(self, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (outer_enum.OuterEnum,), + 'body': + (outer_enum.OuterEnum,), }, 'attribute_map': { }, @@ -553,7 +558,8 @@ def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (outer_number.OuterNumber,), + 'body': + (outer_number.OuterNumber,), }, 'attribute_map': { }, @@ -655,7 +661,8 @@ def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (str,), + 'body': + (str,), }, 'attribute_map': { }, @@ -728,7 +735,8 @@ def __test_body_with_file_schema(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_body_with_file_schema = Endpoint( @@ -760,7 +768,8 @@ def __test_body_with_file_schema(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (file_schema_test_class.FileSchemaTestClass,), + 'body': + (file_schema_test_class.FileSchemaTestClass,), }, 'attribute_map': { }, @@ -833,8 +842,10 @@ def __test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['query'] = query - kwargs['body'] = body + kwargs['query'] = \ + query + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_body_with_query_params = Endpoint( @@ -868,8 +879,10 @@ def __test_body_with_query_params(self, query, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'query': (str,), - 'body': (user.User,), + 'query': + (str,), + 'body': + (user.User,), }, 'attribute_map': { 'query': 'query', @@ -944,7 +957,8 @@ def __test_client_model(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_client_model = Endpoint( @@ -976,7 +990,8 @@ def __test_client_model(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (client.Client,), + 'body': + (client.Client,), }, 'attribute_map': { }, @@ -1055,11 +1070,16 @@ def __test_endpoint_enums_length_one(self, query_integer, query_string, path_str '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['query_integer'] = query_integer - kwargs['query_string'] = query_string - kwargs['path_string'] = path_string - kwargs['path_integer'] = path_integer - kwargs['header_number'] = header_number + kwargs['query_integer'] = \ + query_integer + kwargs['query_string'] = \ + query_string + kwargs['path_string'] = \ + path_string + kwargs['path_integer'] = \ + path_integer + kwargs['header_number'] = \ + header_number return self.call_with_http_info(**kwargs) self.test_endpoint_enums_length_one = Endpoint( @@ -1124,11 +1144,16 @@ def __test_endpoint_enums_length_one(self, query_integer, query_string, path_str }, }, 'openapi_types': { - 'query_integer': (int,), - 'query_string': (str,), - 'path_string': (str,), - 'path_integer': (int,), - 'header_number': (float,), + 'query_integer': + (int,), + 'query_string': + (str,), + 'path_string': + (str,), + 'path_integer': + (int,), + 'header_number': + (float,), }, 'attribute_map': { 'query_integer': 'query_integer', @@ -1221,10 +1246,14 @@ def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['number'] = number - kwargs['double'] = double - kwargs['pattern_without_delimiter'] = pattern_without_delimiter - kwargs['byte'] = byte + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte return self.call_with_http_info(**kwargs) self.test_endpoint_parameters = Endpoint( @@ -1323,20 +1352,34 @@ def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, 'allowed_values': { }, 'openapi_types': { - 'number': (float,), - 'double': (float,), - 'pattern_without_delimiter': (str,), - 'byte': (str,), - 'integer': (int,), - 'int32': (int,), - 'int64': (int,), - 'float': (float,), - 'string': (str,), - 'binary': (file_type,), - 'date': (date,), - 'date_time': (datetime,), - 'password': (str,), - 'param_callback': (str,), + 'number': + (float,), + 'double': + (float,), + 'pattern_without_delimiter': + (str,), + 'byte': + (str,), + 'integer': + (int,), + 'int32': + (int,), + 'int64': + (int,), + 'float': + (float,), + 'string': + (str,), + 'binary': + (file_type,), + 'date': + (date,), + 'date_time': + (datetime,), + 'password': + (str,), + 'param_callback': + (str,), }, 'attribute_map': { 'number': 'number', @@ -1530,14 +1573,22 @@ def __test_enum_parameters(self, **kwargs): # noqa: E501 }, }, 'openapi_types': { - 'enum_header_string_array': ([str],), - 'enum_header_string': (str,), - 'enum_query_string_array': ([str],), - 'enum_query_string': (str,), - 'enum_query_integer': (int,), - 'enum_query_double': (float,), - 'enum_form_string_array': ([str],), - 'enum_form_string': (str,), + 'enum_header_string_array': + ([str],), + 'enum_header_string': + (str,), + 'enum_query_string_array': + ([str],), + 'enum_query_string': + (str,), + 'enum_query_integer': + (int,), + 'enum_query_double': + (float,), + 'enum_form_string_array': + ([str],), + 'enum_form_string': + (str,), }, 'attribute_map': { 'enum_header_string_array': 'enum_header_string_array', @@ -1633,9 +1684,12 @@ def __test_group_parameters(self, required_string_group, required_boolean_group, '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['required_string_group'] = required_string_group - kwargs['required_boolean_group'] = required_boolean_group - kwargs['required_int64_group'] = required_int64_group + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group return self.call_with_http_info(**kwargs) self.test_group_parameters = Endpoint( @@ -1674,12 +1728,18 @@ def __test_group_parameters(self, required_string_group, required_boolean_group, 'allowed_values': { }, 'openapi_types': { - 'required_string_group': (int,), - 'required_boolean_group': (bool,), - 'required_int64_group': (int,), - 'string_group': (int,), - 'boolean_group': (bool,), - 'int64_group': (int,), + 'required_string_group': + (int,), + 'required_boolean_group': + (bool,), + 'required_int64_group': + (int,), + 'string_group': + (int,), + 'boolean_group': + (bool,), + 'int64_group': + (int,), }, 'attribute_map': { 'required_string_group': 'required_string_group', @@ -1760,7 +1820,8 @@ def __test_inline_additional_properties(self, param, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['param'] = param + kwargs['param'] = \ + param return self.call_with_http_info(**kwargs) self.test_inline_additional_properties = Endpoint( @@ -1792,7 +1853,8 @@ def __test_inline_additional_properties(self, param, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'param': ({str: (str,)},), + 'param': + ({str: (str,)},), }, 'attribute_map': { }, @@ -1865,8 +1927,10 @@ def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['param'] = param - kwargs['param2'] = param2 + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 return self.call_with_http_info(**kwargs) self.test_json_form_data = Endpoint( @@ -1900,8 +1964,10 @@ def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'param': (str,), - 'param2': (str,), + 'param': + (str,), + 'param2': + (str,), }, 'attribute_map': { 'param': 'param', diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index b10c7cd39150..ba0386f633a0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -102,7 +102,8 @@ def __test_classname(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.test_classname = Endpoint( @@ -136,7 +137,8 @@ def __test_classname(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (client.Client,), + 'body': + (client.Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index e7e1cf19c009..3eeae195e0aa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -102,7 +102,8 @@ def __add_pet(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.add_pet = Endpoint( @@ -136,7 +137,8 @@ def __add_pet(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (pet.Pet,), + 'body': + (pet.Pet,), }, 'attribute_map': { }, @@ -210,7 +212,8 @@ def __delete_pet(self, pet_id, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.delete_pet = Endpoint( @@ -245,8 +248,10 @@ def __delete_pet(self, pet_id, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'api_key': (str,), + 'pet_id': + (int,), + 'api_key': + (str,), }, 'attribute_map': { 'pet_id': 'petId', @@ -320,7 +325,8 @@ def __find_pets_by_status(self, status, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['status'] = status + kwargs['status'] = \ + status return self.call_with_http_info(**kwargs) self.find_pets_by_status = Endpoint( @@ -361,7 +367,8 @@ def __find_pets_by_status(self, status, **kwargs): # noqa: E501 }, }, 'openapi_types': { - 'status': ([str],), + 'status': + ([str],), }, 'attribute_map': { 'status': 'status', @@ -437,7 +444,8 @@ def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['tags'] = tags + kwargs['tags'] = \ + tags return self.call_with_http_info(**kwargs) self.find_pets_by_tags = Endpoint( @@ -471,7 +479,8 @@ def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'tags': ([str],), + 'tags': + ([str],), }, 'attribute_map': { 'tags': 'tags', @@ -547,7 +556,8 @@ def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.get_pet_by_id = Endpoint( @@ -581,7 +591,8 @@ def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), + 'pet_id': + (int,), }, 'attribute_map': { 'pet_id': 'petId', @@ -655,7 +666,8 @@ def __update_pet(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.update_pet = Endpoint( @@ -689,7 +701,8 @@ def __update_pet(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (pet.Pet,), + 'body': + (pet.Pet,), }, 'attribute_map': { }, @@ -764,7 +777,8 @@ def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.update_pet_with_form = Endpoint( @@ -800,9 +814,12 @@ def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'name': (str,), - 'status': (str,), + 'pet_id': + (int,), + 'name': + (str,), + 'status': + (str,), }, 'attribute_map': { 'pet_id': 'petId', @@ -882,7 +899,8 @@ def __upload_file(self, pet_id, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id + kwargs['pet_id'] = \ + pet_id return self.call_with_http_info(**kwargs) self.upload_file = Endpoint( @@ -919,10 +937,14 @@ def __upload_file(self, pet_id, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'additional_metadata': (str,), - 'file': (file_type,), - 'files': ([file_type],), + 'pet_id': + (int,), + 'additional_metadata': + (str,), + 'file': + (file_type,), + 'files': + ([file_type],), }, 'attribute_map': { 'pet_id': 'petId', @@ -1006,8 +1028,10 @@ def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['pet_id'] = pet_id - kwargs['required_file'] = required_file + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file return self.call_with_http_info(**kwargs) self.upload_file_with_required_file = Endpoint( @@ -1044,9 +1068,12 @@ def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # 'allowed_values': { }, 'openapi_types': { - 'pet_id': (int,), - 'required_file': (file_type,), - 'additional_metadata': (str,), + 'pet_id': + (int,), + 'required_file': + (file_type,), + 'additional_metadata': + (str,), }, 'attribute_map': { 'pet_id': 'petId', diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index bb1367b167e9..e429d348e670 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -102,7 +102,8 @@ def __delete_order(self, order_id, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['order_id'] = order_id + kwargs['order_id'] = \ + order_id return self.call_with_http_info(**kwargs) self.delete_order = Endpoint( @@ -134,7 +135,8 @@ def __delete_order(self, order_id, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'order_id': (str,), + 'order_id': + (str,), }, 'attribute_map': { 'order_id': 'order_id', @@ -306,7 +308,8 @@ def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['order_id'] = order_id + kwargs['order_id'] = \ + order_id return self.call_with_http_info(**kwargs) self.get_order_by_id = Endpoint( @@ -344,7 +347,8 @@ def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'order_id': (int,), + 'order_id': + (int,), }, 'attribute_map': { 'order_id': 'order_id', @@ -418,7 +422,8 @@ def __place_order(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.place_order = Endpoint( @@ -450,7 +455,8 @@ def __place_order(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (order.Order,), + 'body': + (order.Order,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 17e2428b84c7..9f754bb50a60 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -102,7 +102,8 @@ def __create_user(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.create_user = Endpoint( @@ -134,7 +135,8 @@ def __create_user(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': (user.User,), + 'body': + (user.User,), }, 'attribute_map': { }, @@ -204,7 +206,8 @@ def __create_users_with_array_input(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.create_users_with_array_input = Endpoint( @@ -236,7 +239,8 @@ def __create_users_with_array_input(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': ([user.User],), + 'body': + ([user.User],), }, 'attribute_map': { }, @@ -306,7 +310,8 @@ def __create_users_with_list_input(self, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['body'] = body + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.create_users_with_list_input = Endpoint( @@ -338,7 +343,8 @@ def __create_users_with_list_input(self, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'body': ([user.User],), + 'body': + ([user.User],), }, 'attribute_map': { }, @@ -409,7 +415,8 @@ def __delete_user(self, username, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username + kwargs['username'] = \ + username return self.call_with_http_info(**kwargs) self.delete_user = Endpoint( @@ -441,7 +448,8 @@ def __delete_user(self, username, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'username': (str,), + 'username': + (str,), }, 'attribute_map': { 'username': 'username', @@ -512,7 +520,8 @@ def __get_user_by_name(self, username, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username + kwargs['username'] = \ + username return self.call_with_http_info(**kwargs) self.get_user_by_name = Endpoint( @@ -544,7 +553,8 @@ def __get_user_by_name(self, username, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'username': (str,), + 'username': + (str,), }, 'attribute_map': { 'username': 'username', @@ -619,8 +629,10 @@ def __login_user(self, username, password, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - kwargs['password'] = password + kwargs['username'] = \ + username + kwargs['password'] = \ + password return self.call_with_http_info(**kwargs) self.login_user = Endpoint( @@ -654,8 +666,10 @@ def __login_user(self, username, password, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'username': (str,), - 'password': (str,), + 'username': + (str,), + 'password': + (str,), }, 'attribute_map': { 'username': 'username', @@ -828,8 +842,10 @@ def __update_user(self, username, body, **kwargs): # noqa: E501 '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index', 0) - kwargs['username'] = username - kwargs['body'] = body + kwargs['username'] = \ + username + kwargs['body'] = \ + body return self.call_with_http_info(**kwargs) self.update_user = Endpoint( @@ -863,8 +879,10 @@ def __update_user(self, username, body, **kwargs): # noqa: E501 'allowed_values': { }, 'openapi_types': { - 'username': (str,), - 'body': (user.User,), + 'username': + (str,), + 'body': + (user.User,), }, 'attribute_map': { 'username': 'username', diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index 2da7a5923a5b..abb0d49e74c9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -31,11 +31,13 @@ try: from petstore_api.models import cat except ImportError: - cat = sys.modules['petstore_api.models.cat'] + cat = sys.modules[ + 'petstore_api.models.cat'] try: from petstore_api.models import dog except ImportError: - dog = sys.modules['petstore_api.models.dog'] + dog = sys.modules[ + 'petstore_api.models.dog'] class Animal(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index 3c15d79a3d01..c99bc985cab1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import read_only_first except ImportError: - read_only_first = sys.modules['petstore_api.models.read_only_first'] + read_only_first = sys.modules[ + 'petstore_api.models.read_only_first'] class ArrayTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index 6b4985dc4a9b..229d04455540 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -31,11 +31,13 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import cat_all_of except ImportError: - cat_all_of = sys.modules['petstore_api.models.cat_all_of'] + cat_all_of = sys.modules[ + 'petstore_api.models.cat_all_of'] class Cat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/models/child.py index 8a61f35ba14b..9721a0b684f4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_all_of except ImportError: - child_all_of = sys.modules['petstore_api.models.child_all_of'] + child_all_of = sys.modules[ + 'petstore_api.models.child_all_of'] try: from petstore_api.models import parent except ImportError: - parent = sys.modules['petstore_api.models.parent'] + parent = sys.modules[ + 'petstore_api.models.parent'] class Child(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index b329281e9c25..7828dba8cb87 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_cat_all_of except ImportError: - child_cat_all_of = sys.modules['petstore_api.models.child_cat_all_of'] + child_cat_all_of = sys.modules[ + 'petstore_api.models.child_cat_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildCat(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index eaea5cba93c8..36180f157134 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_dog_all_of except ImportError: - child_dog_all_of = sys.modules['petstore_api.models.child_dog_all_of'] + child_dog_all_of = sys.modules[ + 'petstore_api.models.child_dog_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildDog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index a038974bb543..cb79d4ad6048 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -31,11 +31,13 @@ try: from petstore_api.models import child_lizard_all_of except ImportError: - child_lizard_all_of = sys.modules['petstore_api.models.child_lizard_all_of'] + child_lizard_all_of = sys.modules[ + 'petstore_api.models.child_lizard_all_of'] try: from petstore_api.models import parent_pet except ImportError: - parent_pet = sys.modules['petstore_api.models.parent_pet'] + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class ChildLizard(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index 54ccf0e390ab..b29e31d4e5d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -31,11 +31,13 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] try: from petstore_api.models import dog_all_of except ImportError: - dog_all_of = sys.modules['petstore_api.models.dog_all_of'] + dog_all_of = sys.modules[ + 'petstore_api.models.dog_all_of'] class Dog(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 5df1bcbc2e7d..42a4c562150c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import outer_enum except ImportError: - outer_enum = sys.modules['petstore_api.models.outer_enum'] + outer_enum = sys.modules[ + 'petstore_api.models.outer_enum'] class EnumTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 62a9a4194a18..f1abb16cbc33 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -31,7 +31,8 @@ try: from petstore_api.models import file except ImportError: - file = sys.modules['petstore_api.models.file'] + file = sys.modules[ + 'petstore_api.models.file'] class FileSchemaTestClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index e6680cc73493..e996e27991c1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -31,7 +31,8 @@ try: from petstore_api.models import string_boolean_map except ImportError: - string_boolean_map = sys.modules['petstore_api.models.string_boolean_map'] + string_boolean_map = sys.modules[ + 'petstore_api.models.string_boolean_map'] class MapTest(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 52969b942bfa..60b897624568 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -31,7 +31,8 @@ try: from petstore_api.models import animal except ImportError: - animal = sys.modules['petstore_api.models.animal'] + animal = sys.modules[ + 'petstore_api.models.animal'] class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index 013e386adff8..067ac6a14007 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -31,7 +31,8 @@ try: from petstore_api.models import outer_number except ImportError: - outer_number = sys.modules['petstore_api.models.outer_number'] + outer_number = sys.modules[ + 'petstore_api.models.outer_number'] class OuterComposite(ModelNormal): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/models/parent.py index 4175d7792f63..70534d8026eb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent.py @@ -31,11 +31,13 @@ try: from petstore_api.models import grandparent except ImportError: - grandparent = sys.modules['petstore_api.models.grandparent'] + grandparent = sys.modules[ + 'petstore_api.models.grandparent'] try: from petstore_api.models import parent_all_of except ImportError: - parent_all_of = sys.modules['petstore_api.models.parent_all_of'] + parent_all_of = sys.modules[ + 'petstore_api.models.parent_all_of'] class Parent(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index d98bdc6f6570..16d00f42da53 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -31,19 +31,23 @@ try: from petstore_api.models import child_cat except ImportError: - child_cat = sys.modules['petstore_api.models.child_cat'] + child_cat = sys.modules[ + 'petstore_api.models.child_cat'] try: from petstore_api.models import child_dog except ImportError: - child_dog = sys.modules['petstore_api.models.child_dog'] + child_dog = sys.modules[ + 'petstore_api.models.child_dog'] try: from petstore_api.models import child_lizard except ImportError: - child_lizard = sys.modules['petstore_api.models.child_lizard'] + child_lizard = sys.modules[ + 'petstore_api.models.child_lizard'] try: from petstore_api.models import grandparent_animal except ImportError: - grandparent_animal = sys.modules['petstore_api.models.grandparent_animal'] + grandparent_animal = sys.modules[ + 'petstore_api.models.grandparent_animal'] class ParentPet(ModelComposed): diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 83b4679eb7a3..11ffa6ff44f5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -31,11 +31,13 @@ try: from petstore_api.models import category except ImportError: - category = sys.modules['petstore_api.models.category'] + category = sys.modules[ + 'petstore_api.models.category'] try: from petstore_api.models import tag except ImportError: - tag = sys.modules['petstore_api.models.tag'] + tag = sys.modules[ + 'petstore_api.models.tag'] class Pet(ModelNormal): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b022435..134d6aea416a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 001eede94137..368b4edffb93 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -347,7 +347,7 @@ open class AlamofireDecodableRequestBuilder: AlamofireRequestBuild case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } }) diff --git a/samples/client/petstore/swift5/alamofireLibrary/README.md b/samples/client/petstore/swift5/alamofireLibrary/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/README.md +++ b/samples/client/petstore/swift5/alamofireLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md index 49d4d3fb6a13..0e9325f77e94 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/alamofireLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 442dd29191b2..47510b7781a5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -282,7 +282,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -316,9 +316,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 9e552cce099f..6084a18be722 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/combineLibrary/README.md b/samples/client/petstore/swift5/combineLibrary/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/combineLibrary/README.md +++ b/samples/client/petstore/swift5/combineLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md index 49d4d3fb6a13..0e9325f77e94 100644 --- a/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/combineLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b022435..134d6aea416a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 9e552cce099f..6084a18be722 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/default/README.md b/samples/client/petstore/swift5/default/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/default/README.md +++ b/samples/client/petstore/swift5/default/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/default/docs/FakeAPI.md b/samples/client/petstore/swift5/default/docs/FakeAPI.md index 49d4d3fb6a13..0e9325f77e94 100644 --- a/samples/client/petstore/swift5/default/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/default/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 93a7c43079ee..ab1b8f092475 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ internal class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter integer: (form) None (optional) - parameter int32: (form) None (optional) @@ -291,9 +291,9 @@ internal class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 2f430c08e265..876ba9195b1c 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ internal class URLSessionDecodableRequestBuilder: URLSessionReques case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/nonPublicApi/README.md b/samples/client/petstore/swift5/nonPublicApi/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/nonPublicApi/README.md +++ b/samples/client/petstore/swift5/nonPublicApi/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md b/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md index f8e42ac4df80..6a16d54b005a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/nonPublicApi/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b022435..134d6aea416a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 9e552cce099f..6084a18be722 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/objcCompatible/README.md b/samples/client/petstore/swift5/objcCompatible/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/objcCompatible/README.md +++ b/samples/client/petstore/swift5/objcCompatible/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md b/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md index c7e27b881fdb..63b00fcbfa59 100644 --- a/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/objcCompatible/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 1a37c8113c2d..80153ba634d3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -275,7 +275,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -308,9 +308,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 9e552cce099f..6084a18be722 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/promisekitLibrary/README.md b/samples/client/petstore/swift5/promisekitLibrary/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/README.md +++ b/samples/client/petstore/swift5/promisekitLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md index bf8e514f03d7..72c908dd5898 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/promisekitLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -346,9 +346,9 @@ No authorization required open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -370,7 +370,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).then { // when the promise is fulfilled }.always { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 02d14692f949..2764fb314ab0 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 9e552cce099f..6084a18be722 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/resultLibrary/README.md b/samples/client/petstore/swift5/resultLibrary/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/resultLibrary/README.md +++ b/samples/client/petstore/swift5/resultLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md index 49d4d3fb6a13..0e9325f77e94 100644 --- a/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/resultLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index cad139a00bab..3e9b32438c82 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -289,7 +289,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -324,9 +324,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 9e552cce099f..6084a18be722 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/README.md b/samples/client/petstore/swift5/rxswiftLibrary/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/README.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md index a9a6c32c98bd..872c0359f04b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -303,9 +303,9 @@ No authorization required open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index dfbb6b022435..134d6aea416a 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - parameter number: (form) None - parameter double: (form) None @@ -291,9 +291,9 @@ open class FakeAPI { } /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - BASIC: - type: http - name: http_basic_test diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 9e552cce099f..6084a18be722 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/README.md b/samples/client/petstore/swift5/urlsessionLibrary/README.md index 2a7b47d57c05..4829f29f6afe 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/README.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/README.md @@ -33,7 +33,7 @@ Class | Method | HTTP request | Description *FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | *FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | *FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties diff --git a/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md b/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md index 49d4d3fb6a13..0e9325f77e94 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/docs/FakeAPI.md @@ -11,7 +11,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -367,9 +367,9 @@ No authorization required open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) ``` -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ### Example ```swift @@ -391,7 +391,7 @@ let dateTime = Date() // Date | None (optional) let password = "password_example" // String | None (optional) let callback = "callback_example" // String | None (optional) -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in guard error == nil else { print(error) diff --git a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift index bfcda0b6485b..bcc49ecc7cad 100644 --- a/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/test/swift5/default/TestClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -32,6 +32,7 @@ open class URLSessionRequestBuilder: RequestBuilder { observation?.invalidate() } + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() /** @@ -371,7 +372,7 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) case let .failure(error): - completion(.failure(error)) + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) } } } diff --git a/samples/openapi3/client/petstore/python-experimental/.gitignore b/samples/openapi3/client/petstore/python-experimental/.gitignore new file mode 100644 index 000000000000..43995bd42fa2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION new file mode 100644 index 000000000000..58592f031f65 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/.travis.yml b/samples/openapi3/client/petstore/python-experimental/.travis.yml new file mode 100644 index 000000000000..388de83128fe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.travis.yml @@ -0,0 +1,15 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/samples/openapi3/client/petstore/python-experimental/Makefile b/samples/openapi3/client/petstore/python-experimental/Makefile new file mode 100644 index 000000000000..9354f43d5096 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/Makefile @@ -0,0 +1,19 @@ +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test: clean + bash ./test_python2.sh + +test-all: clean + bash ./test_python2_and_3.sh diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md new file mode 100644 index 000000000000..8e82b0a81f3f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -0,0 +1,210 @@ +# petstore-api +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 Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.PythonClientExperimentalCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import petstore_api +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import petstore_api +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi(petstore_api.ApiClient(configuration)) +client_client = petstore_api.Client() # client.Client | client model + +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | +*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**test_enum_parameters**](docs/FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*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 +*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 +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [additional_properties_class.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [animal.Animal](docs/Animal.md) + - [api_response.ApiResponse](docs/ApiResponse.md) + - [array_of_array_of_number_only.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [array_of_number_only.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [array_test.ArrayTest](docs/ArrayTest.md) + - [capitalization.Capitalization](docs/Capitalization.md) + - [cat.Cat](docs/Cat.md) + - [cat_all_of.CatAllOf](docs/CatAllOf.md) + - [category.Category](docs/Category.md) + - [class_model.ClassModel](docs/ClassModel.md) + - [client.Client](docs/Client.md) + - [dog.Dog](docs/Dog.md) + - [dog_all_of.DogAllOf](docs/DogAllOf.md) + - [enum_arrays.EnumArrays](docs/EnumArrays.md) + - [enum_class.EnumClass](docs/EnumClass.md) + - [enum_test.EnumTest](docs/EnumTest.md) + - [file.File](docs/File.md) + - [file_schema_test_class.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [foo.Foo](docs/Foo.md) + - [format_test.FormatTest](docs/FormatTest.md) + - [has_only_read_only.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [health_check_result.HealthCheckResult](docs/HealthCheckResult.md) + - [inline_object.InlineObject](docs/InlineObject.md) + - [inline_object1.InlineObject1](docs/InlineObject1.md) + - [inline_object2.InlineObject2](docs/InlineObject2.md) + - [inline_object3.InlineObject3](docs/InlineObject3.md) + - [inline_object4.InlineObject4](docs/InlineObject4.md) + - [inline_object5.InlineObject5](docs/InlineObject5.md) + - [inline_response_default.InlineResponseDefault](docs/InlineResponseDefault.md) + - [list.List](docs/List.md) + - [map_test.MapTest](docs/MapTest.md) + - [mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [model200_response.Model200Response](docs/Model200Response.md) + - [model_return.ModelReturn](docs/ModelReturn.md) + - [name.Name](docs/Name.md) + - [nullable_class.NullableClass](docs/NullableClass.md) + - [number_only.NumberOnly](docs/NumberOnly.md) + - [order.Order](docs/Order.md) + - [outer_composite.OuterComposite](docs/OuterComposite.md) + - [outer_enum.OuterEnum](docs/OuterEnum.md) + - [outer_enum_default_value.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [outer_enum_integer.OuterEnumInteger](docs/OuterEnumInteger.md) + - [outer_enum_integer_default_value.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [pet.Pet](docs/Pet.md) + - [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [special_model_name.SpecialModelName](docs/SpecialModelName.md) + - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) + - [tag.Tag](docs/Tag.md) + - [user.User](docs/User.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **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 + + +## bearer_test + +- **Type**: Bearer authentication (JWT) + + +## http_basic_test + +- **Type**: HTTP basic authentication + + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + + diff --git a/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt b/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt new file mode 100644 index 000000000000..ccdfca629494 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/dev-requirements.txt @@ -0,0 +1,2 @@ +tox +flake8 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..4df80090d8ec --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# additional_properties_class.AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_property** | **{str: (str,)}** | | [optional] +**map_of_map_property** | **{str: ({str: (str,)},)}** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md new file mode 100644 index 000000000000..fda84ee28eea --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md @@ -0,0 +1,11 @@ +# animal.Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..b9a702534924 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -0,0 +1,63 @@ +# petstore_api.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags + + +# **call_123_test_special_tags** +> client.Client call_123_test_special_tags(client_client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.AnotherFakeApi() +client_client = petstore_api.Client() # client.Client | client model + +# example passing only required values which don't have defaults set +try: + # To test special tags + api_response = api_instance.call_123_test_special_tags(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client_client** | [**client.Client**](Client.md)| client model | + +### Return type + +[**client.Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md new file mode 100644 index 000000000000..8f7ffa461340 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# api_response.ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **int** | | [optional] +**type** | **str** | | [optional] +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..ab82c8c556d0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# array_of_array_of_number_only.ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_array_number** | **[[float]]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..b8ffd843c8d8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ +# array_of_number_only.ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_number** | **[float]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md new file mode 100644 index 000000000000..22f198440e7b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md @@ -0,0 +1,12 @@ +# array_test.ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**array_of_string** | **[str]** | | [optional] +**array_array_of_integer** | **[[int]]** | | [optional] +**array_array_of_model** | [**[[read_only_first.ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md new file mode 100644 index 000000000000..d402f2a571a8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md @@ -0,0 +1,15 @@ +# capitalization.Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**small_camel** | **str** | | [optional] +**capital_camel** | **str** | | [optional] +**small_snake** | **str** | | [optional] +**capital_snake** | **str** | | [optional] +**sca_eth_flow_points** | **str** | | [optional] +**att_name** | **str** | Name of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md new file mode 100644 index 000000000000..1d7b5b26d715 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md @@ -0,0 +1,12 @@ +# cat.Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**declawed** | **bool** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md new file mode 100644 index 000000000000..653bb0aa3538 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md @@ -0,0 +1,10 @@ +# cat_all_of.CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md new file mode 100644 index 000000000000..bb122d910fcd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Category.md @@ -0,0 +1,11 @@ +# category.Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | defaults to 'default-name' +**id** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md new file mode 100644 index 000000000000..3f5d0075c1bb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md @@ -0,0 +1,11 @@ +# class_model.ClassModel + +Model for testing model with \"_class\" property +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md new file mode 100644 index 000000000000..4c7ce57f750f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Client.md @@ -0,0 +1,10 @@ +# client.Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md new file mode 100644 index 000000000000..cf6c28c597cc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -0,0 +1,56 @@ +# petstore_api.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo | + + +# **foo_get** +> inline_response_default.InlineResponseDefault foo_get() + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.DefaultApi() + +# example, this endpoint has no required or optional parameters +try: + api_response = api_instance.foo_get() + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling DefaultApi->foo_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**inline_response_default.InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | response | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md new file mode 100644 index 000000000000..ec98b99dcec5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md @@ -0,0 +1,12 @@ +# dog.Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**class_name** | **str** | | +**breed** | **str** | | [optional] +**color** | **str** | | [optional] if omitted the server will use the default value of 'red' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md new file mode 100644 index 000000000000..da3c29557df7 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md @@ -0,0 +1,10 @@ +# dog_all_of.DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md new file mode 100644 index 000000000000..c2f22d45047c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md @@ -0,0 +1,11 @@ +# enum_arrays.EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_symbol** | **str** | | [optional] +**array_enum** | **[str]** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md new file mode 100644 index 000000000000..333307fde46c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -0,0 +1,10 @@ +# enum_class.EnumClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md new file mode 100644 index 000000000000..aee196204f99 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -0,0 +1,17 @@ +# enum_test.EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_string_required** | **str** | | +**enum_string** | **str** | | [optional] +**enum_integer** | **int** | | [optional] +**enum_number** | **float** | | [optional] +**outer_enum** | [**outer_enum.OuterEnum**](OuterEnum.md) | | [optional] +**outer_enum_integer** | [**outer_enum_integer.OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outer_enum_default_value** | [**outer_enum_default_value.OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outer_enum_integer_default_value** | [**outer_enum_integer_default_value.OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md new file mode 100644 index 000000000000..63cbd5d18424 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -0,0 +1,849 @@ +# petstore_api.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | +[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | +[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | +[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string | +[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema | +[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params | +[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model +[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**test_enum_parameters**](FakeApi.md#test_enum_parameters) | **GET** /fake | To test enum parameters +[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data +[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-paramters | + + +# **fake_health_get** +> health_check_result.HealthCheckResult fake_health_get() + +Health check endpoint + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() + +# example, this endpoint has no required or optional parameters +try: + # Health check endpoint + api_response = api_instance.fake_health_get() + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_health_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**health_check_result.HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[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) + +# **fake_outer_boolean_serialize** +> bool fake_outer_boolean_serialize() + + + +Test serialization of outer boolean types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = True # bool | Input boolean as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_boolean_serialize(body=body) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **bool**| Input boolean as post body | [optional] + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + +[[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) + +# **fake_outer_composite_serialize** +> outer_composite.OuterComposite fake_outer_composite_serialize() + + + +Test serialization of object with outer number type + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +outer_composite_outer_composite = petstore_api.OuterComposite() # outer_composite.OuterComposite | Input composite as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_composite_serialize(outer_composite_outer_composite=outer_composite_outer_composite) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outer_composite_outer_composite** | [**outer_composite.OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**outer_composite.OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + +[[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) + +# **fake_outer_number_serialize** +> float fake_outer_number_serialize() + + + +Test serialization of outer number types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 3.4 # float | Input number as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_number_serialize(body=body) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **float**| Input number as post body | [optional] + +### Return type + +**float** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + +[[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) + +# **fake_outer_string_serialize** +> str fake_outer_string_serialize() + + + +Test serialization of outer string types + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +body = 'body_example' # str | Input string as post body (optional) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.fake_outer_string_serialize(body=body) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **str**| Input string as post body | [optional] + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_file_schema** +> test_body_with_file_schema(file_schema_test_class_file_schema_test_class) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +file_schema_test_class_file_schema_test_class = petstore_api.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + +# example passing only required values which don't have defaults set +try: + api_instance.test_body_with_file_schema(file_schema_test_class_file_schema_test_class) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file_schema_test_class_file_schema_test_class** | [**file_schema_test_class.FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_body_with_query_params** +> test_body_with_query_params(query, user_user) + + + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +query = 'query_example' # str | +user_user = petstore_api.User() # user.User | + +# example passing only required values which don't have defaults set +try: + api_instance.test_body_with_query_params(query, user_user) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **str**| | + **user_user** | [**user.User**](User.md)| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_client_model** +> client.Client test_client_model(client_client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +client_client = petstore_api.Client() # client.Client | client model + +# example passing only required values which don't have defaults set +try: + # To test \"client\" model + api_response = api_instance.test_client_model(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_client_model: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client_client** | [**client.Client**](Client.md)| client model | + +### Return type + +[**client.Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_endpoint_parameters** +> test_endpoint_parameters(number, double, pattern_without_delimiter, byte) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +* Basic Authentication (http_basic_test): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure HTTP basic authorization: http_basic_test +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +number = 3.4 # float | None +double = 3.4 # float | None +pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None +byte = 'byte_example' # str | None +integer = 56 # int | None (optional) +int32 = 56 # int | None (optional) +int64 = 56 # int | None (optional) +float = 3.4 # float | None (optional) +string = 'string_example' # str | None (optional) +binary = open('/path/to/file', 'rb') # file_type | None (optional) +date = '2013-10-20' # date | None (optional) +date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional) +password = 'password_example' # str | None (optional) +param_callback = 'param_callback_example' # str | None (optional) + +# example passing only required values which don't have defaults set +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, float=float, string=string, binary=binary, date=date, date_time=date_time, password=password, param_callback=param_callback) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **float**| None | + **pattern_without_delimiter** | **str**| None | + **byte** | **str**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **string** | **str**| None | [optional] + **binary** | **file_type**| None | [optional] + **date** | **date**| None | [optional] + **date_time** | **datetime**| None | [optional] + **password** | **str**| None | [optional] + **param_callback** | **str**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_enum_parameters** +> test_enum_parameters() + +To test enum parameters + +To test enum parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +enum_header_string_array = ['enum_header_string_array_example'] # [str] | Header parameter enum test (string array) (optional) +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' +enum_query_string_array = ['enum_query_string_array_example'] # [str] | Query parameter enum test (string array) (optional) +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' +enum_query_integer = 56 # int | Query parameter enum test (double) (optional) +enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) +enum_form_string_array = '$' # [str] | Form parameter enum test (string array) (optional) if omitted the server will use the default value of '$' +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) if omitted the server will use the default value of '-efg' + +# example passing only required values which don't have defaults set +# and optional values +try: + # To test enum parameters + api_instance.test_enum_parameters(enum_header_string_array=enum_header_string_array, enum_header_string=enum_header_string, enum_query_string_array=enum_query_string_array, enum_query_string=enum_query_string, enum_query_integer=enum_query_integer, enum_query_double=enum_query_double, enum_form_string_array=enum_form_string_array, enum_form_string=enum_form_string) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_enum_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enum_header_string_array** | **[str]**| Header parameter enum test (string array) | [optional] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_string_array** | **[str]**| Query parameter enum test (string array) | [optional] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] + **enum_query_double** | **float**| Query parameter enum test (double) | [optional] + **enum_form_string_array** | **[str]**| Form parameter enum test (string array) | [optional] if omitted the server will use the default value of '$' + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_group_parameters** +> test_group_parameters(required_string_group, required_boolean_group, required_int64_group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +* Bearer (JWT) Authentication (bearer_test): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure Bearer authorization (JWT): bearer_test +configuration.access_token = 'YOUR_BEARER_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration)) +required_string_group = 56 # int | Required String in group parameters +required_boolean_group = True # bool | Required Boolean in group parameters +required_int64_group = 56 # int | Required Integer in group parameters +string_group = 56 # int | String in group parameters (optional) +boolean_group = True # bool | Boolean in group parameters (optional) +int64_group = 56 # int | Integer in group parameters (optional) + +# example passing only required values which don't have defaults set +try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Fake endpoint to test group parameters (optional) + api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_group_parameters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **required_string_group** | **int**| Required String in group parameters | + **required_boolean_group** | **bool**| Required Boolean in group parameters | + **required_int64_group** | **int**| Required Integer in group parameters | + **string_group** | **int**| String in group parameters | [optional] + **boolean_group** | **bool**| Boolean in group parameters | [optional] + **int64_group** | **int**| Integer in group parameters | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_inline_additional_properties** +> test_inline_additional_properties(request_body) + +test inline additionalProperties + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +request_body = {'key': 'request_body_example'} # {str: (str,)} | request body + +# example passing only required values which don't have defaults set +try: + # test inline additionalProperties + api_instance.test_inline_additional_properties(request_body) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request_body** | **{str: (str,)}**| request body | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_json_form_data** +> test_json_form_data(param, param2) + +test json serialization of form data + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +param = 'param_example' # str | field1 +param2 = 'param2_example' # str | field2 + +# example passing only required values which don't have defaults set +try: + # test json serialization of form data + api_instance.test_json_form_data(param, param2) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_json_form_data: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **str**| field1 | + **param2** | **str**| field2 | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **test_query_parameter_collection_format** +> test_query_parameter_collection_format(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.FakeApi() +pipe = ['pipe_example'] # [str] | +ioutil = ['ioutil_example'] # [str] | +http = ['http_example'] # [str] | +url = ['url_example'] # [str] | +context = ['context_example'] # [str] | + +# example passing only required values which don't have defaults set +try: + api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context) +except petstore_api.ApiException as e: + print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | **[str]**| | + **ioutil** | **[str]**| | + **http** | **[str]**| | + **url** | **[str]**| | + **context** | **[str]**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..4f78b1bd4cbc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -0,0 +1,71 @@ +# petstore_api.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **test_classname** +> client.Client test_classname(client_client) + +To test class name in snake case + +To test class name in snake case + +### Example + +* Api Key Authentication (api_key_query): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key_query +configuration.api_key['api_key_query'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_query'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.FakeClassnameTags123Api(petstore_api.ApiClient(configuration)) +client_client = petstore_api.Client() # client.Client | client model + +# example passing only required values which don't have defaults set +try: + # To test class name in snake case + api_response = api_instance.test_classname(client_client) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client_client** | [**client.Client**](Client.md)| client model | + +### Return type + +[**client.Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md new file mode 100644 index 000000000000..2847323a0989 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/File.md @@ -0,0 +1,11 @@ +# file.File + +Must be named `File` for test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_uri** | **str** | Test capitalization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..807350c62f2c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ +# file_schema_test_class.FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**file.File**](File.md) | | [optional] +**files** | [**[file.File]**](File.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md new file mode 100644 index 000000000000..570d1dac0930 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md @@ -0,0 +1,10 @@ +# foo.Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] if omitted the server will use the default value of 'bar' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md new file mode 100644 index 000000000000..cb7e31877a70 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md @@ -0,0 +1,24 @@ +# format_test.FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | | +**byte** | **str** | | +**date** | **date** | | +**password** | **str** | | +**integer** | **int** | | [optional] +**int32** | **int** | | [optional] +**int64** | **int** | | [optional] +**float** | **float** | | [optional] +**double** | **float** | | [optional] +**string** | **str** | | [optional] +**binary** | **file_type** | | [optional] +**date_time** | **datetime** | | [optional] +**uuid** | **str** | | [optional] +**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..f2194e269ed3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ +# has_only_read_only.HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**foo** | **str** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md new file mode 100644 index 000000000000..280ddc2eaf31 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md @@ -0,0 +1,11 @@ +# health_check_result.HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullable_message** | **str, none_type** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md new file mode 100644 index 000000000000..362cc36d1f03 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md @@ -0,0 +1,11 @@ +# inline_object.InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Updated name of the pet | [optional] +**status** | **str** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md new file mode 100644 index 000000000000..3090ff26994a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# inline_object1.InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additional_metadata** | **str** | Additional data to pass to server | [optional] +**file** | **file_type** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md new file mode 100644 index 000000000000..f8ea923f4e06 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md @@ -0,0 +1,11 @@ +# inline_object2.InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enum_form_string_array** | **[str]** | Form parameter enum test (string array) | [optional] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] if omitted the server will use the default value of '-efg' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md new file mode 100644 index 000000000000..050d635dd255 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md @@ -0,0 +1,23 @@ +# inline_object3.InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **float** | None | +**double** | **float** | None | +**pattern_without_delimiter** | **str** | None | +**byte** | **str** | None | +**integer** | **int** | None | [optional] +**int32** | **int** | None | [optional] +**int64** | **int** | None | [optional] +**float** | **float** | None | [optional] +**string** | **str** | None | [optional] +**binary** | **file_type** | None | [optional] +**date** | **date** | None | [optional] +**date_time** | **datetime** | None | [optional] +**password** | **str** | None | [optional] +**callback** | **str** | None | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md new file mode 100644 index 000000000000..30ee0475e799 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md @@ -0,0 +1,11 @@ +# inline_object4.InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **str** | field1 | +**param2** | **str** | field2 | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md new file mode 100644 index 000000000000..56d245f16831 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md @@ -0,0 +1,11 @@ +# inline_object5.InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**required_file** | **file_type** | file to upload | +**additional_metadata** | **str** | Additional data to pass to server | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..295326496d7d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ +# inline_response_default.InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**foo.Foo**](Foo.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-experimental/docs/List.md new file mode 100644 index 000000000000..28e2ec05968c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/List.md @@ -0,0 +1,10 @@ +# list.List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123_list** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md new file mode 100644 index 000000000000..9fc13abebdc0 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md @@ -0,0 +1,13 @@ +# map_test.MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] +**map_of_enum_string** | **{str: (str,)}** | | [optional] +**direct_map** | **{str: (bool,)}** | | [optional] +**indirect_map** | [**string_boolean_map.StringBooleanMap**](StringBooleanMap.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..87cda996e769 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ +# mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **str** | | [optional] +**date_time** | **datetime** | | [optional] +**map** | [**{str: (animal.Animal,)}**](Animal.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md new file mode 100644 index 000000000000..90f5c2c025d8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md @@ -0,0 +1,12 @@ +# model200_response.Model200Response + +Model for testing model name starting with number +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | [optional] +**_class** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md new file mode 100644 index 000000000000..3be9912b753e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md @@ -0,0 +1,11 @@ +# model_return.ModelReturn + +Model for testing reserved words +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md new file mode 100644 index 000000000000..777b79a3d8bd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Name.md @@ -0,0 +1,14 @@ +# name.Name + +Model for testing model name same as property name +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **int** | | +**snake_case** | **int** | | [optional] [readonly] +**_property** | **str** | | [optional] +**_123_number** | **int** | | [optional] [readonly] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md new file mode 100644 index 000000000000..7b1fe8506a62 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md @@ -0,0 +1,22 @@ +# nullable_class.NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer_prop** | **int, none_type** | | [optional] +**number_prop** | **float, none_type** | | [optional] +**boolean_prop** | **bool, none_type** | | [optional] +**string_prop** | **str, none_type** | | [optional] +**date_prop** | **date, none_type** | | [optional] +**datetime_prop** | **datetime, none_type** | | [optional] +**array_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str], none_type** | | [optional] +**array_and_items_nullable_prop** | **[bool, date, datetime, dict, float, int, list, str, none_type], none_type** | | [optional] +**array_items_nullable** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | | [optional] +**object_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str,)}, none_type** | | [optional] +**object_and_items_nullable_prop** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**object_items_nullable** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md new file mode 100644 index 000000000000..ea1a09d2934d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md @@ -0,0 +1,10 @@ +# number_only.NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**just_number** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md new file mode 100644 index 000000000000..9569ea55e55c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Order.md @@ -0,0 +1,15 @@ +# order.Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**pet_id** | **int** | | [optional] +**quantity** | **int** | | [optional] +**ship_date** | **datetime** | | [optional] +**status** | **str** | Order Status | [optional] +**complete** | **bool** | | [optional] if omitted the server will use the default value of False + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md new file mode 100644 index 000000000000..a389115ee5a9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterComposite.md @@ -0,0 +1,12 @@ +# outer_composite.OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**my_number** | **float** | | [optional] +**my_string** | **str** | | [optional] +**my_boolean** | **bool** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md new file mode 100644 index 000000000000..d1414ba4e613 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnum.md @@ -0,0 +1,10 @@ +# outer_enum.OuterEnum + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str, none_type** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..648f964b6b0e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumDefaultValue.md @@ -0,0 +1,10 @@ +# outer_enum_default_value.OuterEnumDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | defaults to 'placed' + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..de77d44d702f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumInteger.md @@ -0,0 +1,10 @@ +# outer_enum_integer.OuterEnumInteger + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..b8d9b9c0b01d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,10 @@ +# outer_enum_integer_default_value.OuterEnumIntegerDefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **int** | | defaults to 0 + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md new file mode 100644 index 000000000000..a1ea5598e861 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md @@ -0,0 +1,15 @@ +# pet.Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**photo_urls** | **[str]** | | +**id** | **int** | | [optional] +**category** | [**category.Category**](Category.md) | | [optional] +**tags** | [**[tag.Tag]**](Tag.md) | | [optional] +**status** | **str** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md new file mode 100644 index 000000000000..90b5647d5f3a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -0,0 +1,597 @@ +# petstore_api.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet +[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status +[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags +[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID +[**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) + + +# **add_pet** +> add_pet(pet_pet) + +Add a new pet to the store + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + +# example passing only required values which don't have defaults set +try: + # Add a new pet to the store + api_instance.add_pet(pet_pet) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->add_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[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) + +# **delete_pet** +> delete_pet(pet_id) + +Deletes a pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | Pet id to delete +api_key = 'api_key_example' # str | (optional) + +# example passing only required values which don't have defaults set +try: + # Deletes a pet + api_instance.delete_pet(pet_id) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Deletes a pet + api_instance.delete_pet(pet_id, api_key=api_key) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->delete_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **str**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid pet value | - | + +[[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) + +# **find_pets_by_status** +> [pet.Pet] find_pets_by_status(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +status = ['status_example'] # [str] | Status values that need to be considered for filter + +# example passing only required values which don't have defaults set +try: + # Finds Pets by status + api_response = api_instance.find_pets_by_status(status) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_status: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **[str]**| Status values that need to be considered for filter | + +### Return type + +[**[pet.Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + +[[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) + +# **find_pets_by_tags** +> [pet.Pet] find_pets_by_tags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +tags = ['tags_example'] # [str] | Tags to filter by + +# example passing only required values which don't have defaults set +try: + # Finds Pets by tags + api_response = api_instance.find_pets_by_tags(tags) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | **[str]**| Tags to filter by | + +### Return type + +[**[pet.Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + +[[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) + +# **get_pet_by_id** +> pet.Pet get_pet_by_id(pet_id) + +Find pet by ID + +Returns a single pet + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to return + +# example passing only required values which don't have defaults set +try: + # Find pet by ID + api_response = api_instance.get_pet_by_id(pet_id) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->get_pet_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to return | + +### Return type + +[**pet.Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + +[[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 an existing pet + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_pet = petstore_api.Pet() # pet.Pet | Pet object that needs to be added to the store + +# example passing only required values which don't have defaults set +try: + # Update an existing pet + api_instance.update_pet(pet_pet) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + +[[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_with_form** +> update_pet_with_form(pet_id) + +Updates a pet in the store with form data + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet that needs to be updated +name = 'name_example' # str | Updated name of the pet (optional) +status = 'status_example' # str | Updated status of the pet (optional) + +# example passing only required values which don't have defaults set +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Updates a pet in the store with form data + api_instance.update_pet_with_form(pet_id, name=name, status=status) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->update_pet_with_form: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet that needs to be updated | + **name** | **str**| Updated name of the pet | [optional] + **status** | **str**| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + +[[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) + +# **upload_file** +> api_response.ApiResponse upload_file(pet_id) + +uploads an image + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) +file = open('/path/to/file', 'rb') # file_type | file to upload (optional) + +# example passing only required values which don't have defaults set +try: + # uploads an image + api_response = api_instance.upload_file(pet_id) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # uploads an image + api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + **file** | **file_type**| file to upload | [optional] + +### Return type + +[**api_response.ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **upload_file_with_required_file** +> api_response.ApiResponse upload_file_with_required_file(pet_id, required_file) + +uploads an image (required) + +### Example + +* OAuth Authentication (petstore_auth): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure OAuth2 access token for authorization: petstore_auth +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.PetApi(petstore_api.ApiClient(configuration)) +pet_id = 56 # int | ID of pet to update +required_file = open('/path/to/file', 'rb') # file_type | file to upload +additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional) + +# example passing only required values which don't have defaults set +try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # uploads an image (required) + api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| ID of pet to update | + **required_file** | **file_type**| file to upload | + **additional_metadata** | **str**| Additional data to pass to server | [optional] + +### Return type + +[**api_response.ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..252641787c3a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# read_only_first.ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **str** | | [optional] [readonly] +**baz** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md new file mode 100644 index 000000000000..312539af45e3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md @@ -0,0 +1,10 @@ +# special_model_name.SpecialModelName + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**special_property_name** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md new file mode 100644 index 000000000000..a54a8c61fb17 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -0,0 +1,233 @@ +# petstore_api.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**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/{order_id} | Find purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_order(order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 'order_id_example' # str | ID of the order that needs to be deleted + +# example passing only required values which don't have defaults set +try: + # Delete purchase order by ID + api_instance.delete_order(order_id) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->delete_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **str**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[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) + +# **get_inventory** +> {str: (int,)} get_inventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +* Api Key Authentication (api_key): +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint +configuration = petstore_api.Configuration() +# Configure API key authorization: api_key +configuration.api_key['api_key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key'] = 'Bearer' + +# Defining host is optional and default to http://petstore.swagger.io:80/v2 +configuration.host = "http://petstore.swagger.io:80/v2" +# Create an instance of the API class +api_instance = petstore_api.StoreApi(petstore_api.ApiClient(configuration)) + +# example, this endpoint has no required or optional parameters +try: + # Returns pet inventories by status + api_response = api_instance.get_inventory() + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_inventory: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**{str: (int,)}** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[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) + +# **get_order_by_id** +> order.Order get_order_by_id(order_id) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_id = 56 # int | ID of pet that needs to be fetched + +# example passing only required values which don't have defaults set +try: + # Find purchase order by ID + api_response = api_instance.get_order_by_id(order_id) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->get_order_by_id: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| ID of pet that needs to be fetched | + +### Return type + +[**order.Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[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** +> order.Order place_order(order_order) + +Place an order for a pet + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.StoreApi() +order_order = petstore_api.Order() # order.Order | order placed for purchasing the pet + +# example passing only required values which don't have defaults set +try: + # Place an order for a pet + api_response = api_instance.place_order(order_order) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling StoreApi->place_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_order** | [**order.Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**order.Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md new file mode 100644 index 000000000000..2eb94fd9a73d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -0,0 +1,10 @@ +# string_boolean_map.StringBooleanMap + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**any string name** | **bool** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md new file mode 100644 index 000000000000..66f75c28fe4f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md @@ -0,0 +1,11 @@ +# tag.Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**name** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md new file mode 100644 index 000000000000..52ff07af2963 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/User.md @@ -0,0 +1,17 @@ +# user.User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | [optional] +**username** | **str** | | [optional] +**first_name** | **str** | | [optional] +**last_name** | **str** | | [optional] +**email** | **str** | | [optional] +**password** | **str** | | [optional] +**phone** | **str** | | [optional] +**user_status** | **int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md new file mode 100644 index 000000000000..4eb75f428745 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -0,0 +1,437 @@ +# petstore_api.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_user**](UserApi.md#create_user) | **POST** /user | Create user +[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system +[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user + + +# **create_user** +> create_user(user_user) + +Create user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user_user = petstore_api.User() # user.User | Created user object + +# example passing only required values which don't have defaults set +try: + # Create user + api_instance.create_user(user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_user** | [**user.User**](User.md)| Created user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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_user) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user_user = [petstore_api.User()] # [user.User] | List of user object + +# example passing only required values which don't have defaults set +try: + # Creates list of users with given input array + api_instance.create_users_with_array_input(user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_user** | [**[user.User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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_user) + +Creates list of users with given input array + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +user_user = [petstore_api.User()] # [user.User] | List of user object + +# example passing only required values which don't have defaults set +try: + # Creates list of users with given input array + api_instance.create_users_with_list_input(user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_user** | [**[user.User]**](User.md)| List of user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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) + +# **delete_user** +> delete_user(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be deleted + +# example passing only required values which don't have defaults set +try: + # Delete user + api_instance.delete_user(username) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->delete_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[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) + +# **get_user_by_name** +> user.User get_user_by_name(username) + +Get user by user name + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. + +# example passing only required values which don't have defaults set +try: + # Get user by user name + api_response = api_instance.get_user_by_name(username) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->get_user_by_name: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**user.User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[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) + +# **login_user** +> str login_user(username, password) + +Logs user into the system + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | The user name for login +password = 'password_example' # str | The password for login in clear text + +# example passing only required values which don't have defaults set +try: + # Logs user into the system + api_response = api_instance.login_user(username, password) + pprint(api_response) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->login_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The user name for login | + **password** | **str**| The password for login in clear text | + +### Return type + +**str** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
                                                                                                                                                                                                                                                                                                                                                                                                                                    * X-Expires-After - date in UTC when token expires
                                                                                                                                                                                                                                                                                                                                                                                                                                    | +**400** | Invalid username/password supplied | - | + +[[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) + +# **logout_user** +> logout_user() + +Logs out current logged in user session + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() + +# example, this endpoint has no required or optional parameters +try: + # Logs out current logged in user session + api_instance.logout_user() +except petstore_api.ApiException as e: + print("Exception when calling UserApi->logout_user: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[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, user_user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from pprint import pprint + +# Create an instance of the API class +api_instance = petstore_api.UserApi() +username = 'username_example' # str | name that need to be deleted +user_user = petstore_api.User() # user.User | Updated user object + +# example passing only required values which don't have defaults set +try: + # Updated user + api_instance.update_user(username, user_user) +except petstore_api.ApiException as e: + print("Exception when calling UserApi->update_user: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| name that need to be deleted | + **user_user** | [**user.User**](User.md)| Updated user object | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/python-experimental/git_push.sh b/samples/openapi3/client/petstore/python-experimental/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/git_push.sh @@ -0,0 +1,58 @@ +#!/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" + +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" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +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. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +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 + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +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" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py new file mode 100644 index 000000000000..2c9bc6e12f0b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/__init__.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +# flake8: noqa + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "1.0.0" + +# import apis into sdk package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi + +# import ApiClient +from petstore_api.api_client import ApiClient + +# import Configuration +from petstore_api.configuration import Configuration + +# import exceptions +from petstore_api.exceptions import OpenApiException +from petstore_api.exceptions import ApiTypeError +from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiKeyError +from petstore_api.exceptions import ApiException + +# import models into sdk package +from petstore_api.models.additional_properties_class import AdditionalPropertiesClass +from petstore_api.models.animal import Animal +from petstore_api.models.api_response import ApiResponse +from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly +from petstore_api.models.array_of_number_only import ArrayOfNumberOnly +from petstore_api.models.array_test import ArrayTest +from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat +from petstore_api.models.cat_all_of import CatAllOf +from petstore_api.models.category import Category +from petstore_api.models.class_model import ClassModel +from petstore_api.models.client import Client +from petstore_api.models.dog import Dog +from petstore_api.models.dog_all_of import DogAllOf +from petstore_api.models.enum_arrays import EnumArrays +from petstore_api.models.enum_class import EnumClass +from petstore_api.models.enum_test import EnumTest +from petstore_api.models.file import File +from petstore_api.models.file_schema_test_class import FileSchemaTestClass +from petstore_api.models.foo import Foo +from petstore_api.models.format_test import FormatTest +from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.health_check_result import HealthCheckResult +from petstore_api.models.inline_object import InlineObject +from petstore_api.models.inline_object1 import InlineObject1 +from petstore_api.models.inline_object2 import InlineObject2 +from petstore_api.models.inline_object3 import InlineObject3 +from petstore_api.models.inline_object4 import InlineObject4 +from petstore_api.models.inline_object5 import InlineObject5 +from petstore_api.models.inline_response_default import InlineResponseDefault +from petstore_api.models.list import List +from petstore_api.models.map_test import MapTest +from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass +from petstore_api.models.model200_response import Model200Response +from petstore_api.models.model_return import ModelReturn +from petstore_api.models.name import Name +from petstore_api.models.nullable_class import NullableClass +from petstore_api.models.number_only import NumberOnly +from petstore_api.models.order import Order +from petstore_api.models.outer_composite import OuterComposite +from petstore_api.models.outer_enum import OuterEnum +from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue +from petstore_api.models.outer_enum_integer import OuterEnumInteger +from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue +from petstore_api.models.pet import Pet +from petstore_api.models.read_only_first import ReadOnlyFirst +from petstore_api.models.special_model_name import SpecialModelName +from petstore_api.models.string_boolean_map import StringBooleanMap +from petstore_api.models.tag import Tag +from petstore_api.models.user import User diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py new file mode 100644 index 000000000000..fa4e54a80091 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/__init__.py @@ -0,0 +1,12 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from petstore_api.api.another_fake_api import AnotherFakeApi +from petstore_api.api.default_api import DefaultApi +from petstore_api.api.fake_api import FakeApi +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api +from petstore_api.api.pet_api import PetApi +from petstore_api.api.store_api import StoreApi +from petstore_api.api.user_api import UserApi diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py new file mode 100644 index 000000000000..487b15dd082d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -0,0 +1,378 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import client + + +class AnotherFakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __call_123_test_special_tags(self, client_client, **kwargs): # noqa: E501 + """To test special tags # noqa: E501 + + To test special tags and operation ID starting with number # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.call_123_test_special_tags(client_client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param client.Client client_client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: client.Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client_client'] = \ + client_client + return self.call_with_http_info(**kwargs) + + self.call_123_test_special_tags = Endpoint( + settings={ + 'response_type': (client.Client,), + 'auth': [], + 'endpoint_path': '/another-fake/dummy', + 'operation_id': 'call_123_test_special_tags', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client_client', + ], + 'required': [ + 'client_client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client_client': + (client.Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client_client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__call_123_test_special_tags + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py new file mode 100644 index 000000000000..58b7c22e5e92 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -0,0 +1,366 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import inline_response_default + + +class DefaultApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __foo_get(self, **kwargs): # noqa: E501 + """foo_get # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.foo_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: inline_response_default.InlineResponseDefault + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.foo_get = Endpoint( + settings={ + 'response_type': (inline_response_default.InlineResponseDefault,), + 'auth': [], + 'endpoint_path': '/foo', + 'operation_id': 'foo_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__foo_get + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py new file mode 100644 index 000000000000..c967e92c76e1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -0,0 +1,2080 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import health_check_result +from petstore_api.models import outer_composite +from petstore_api.models import file_schema_test_class +from petstore_api.models import user +from petstore_api.models import client + + +class FakeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __fake_health_get(self, **kwargs): # noqa: E501 + """Health check endpoint # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_health_get(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: health_check_result.HealthCheckResult + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_health_get = Endpoint( + settings={ + 'response_type': (health_check_result.HealthCheckResult,), + 'auth': [], + 'endpoint_path': '/fake/health', + 'operation_id': 'fake_health_get', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__fake_health_get + ) + + def __fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 + """fake_outer_boolean_serialize # noqa: E501 + + Test serialization of outer boolean types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_boolean_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param bool body: Input boolean as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: bool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_boolean_serialize = Endpoint( + settings={ + 'response_type': (bool,), + 'auth': [], + 'endpoint_path': '/fake/outer/boolean', + 'operation_id': 'fake_outer_boolean_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (bool,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_boolean_serialize + ) + + def __fake_outer_composite_serialize(self, **kwargs): # noqa: E501 + """fake_outer_composite_serialize # noqa: E501 + + Test serialization of object with outer number type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_composite_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param outer_composite.OuterComposite outer_composite_outer_composite: Input composite as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: outer_composite.OuterComposite + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_composite_serialize = Endpoint( + settings={ + 'response_type': (outer_composite.OuterComposite,), + 'auth': [], + 'endpoint_path': '/fake/outer/composite', + 'operation_id': 'fake_outer_composite_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'outer_composite_outer_composite', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'outer_composite_outer_composite': + (outer_composite.OuterComposite,), + }, + 'attribute_map': { + }, + 'location_map': { + 'outer_composite_outer_composite': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_composite_serialize + ) + + def __fake_outer_number_serialize(self, **kwargs): # noqa: E501 + """fake_outer_number_serialize # noqa: E501 + + Test serialization of outer number types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_number_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float body: Input number as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: float + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_number_serialize = Endpoint( + settings={ + 'response_type': (float,), + 'auth': [], + 'endpoint_path': '/fake/outer/number', + 'operation_id': 'fake_outer_number_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (float,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_number_serialize + ) + + def __fake_outer_string_serialize(self, **kwargs): # noqa: E501 + """fake_outer_string_serialize # noqa: E501 + + Test serialization of outer string types # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_outer_string_serialize(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str body: Input string as post body + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.fake_outer_string_serialize = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/fake/outer/string', + 'operation_id': 'fake_outer_string_serialize', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (str,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + '*/*' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__fake_outer_string_serialize + ) + + def __test_body_with_file_schema(self, file_schema_test_class_file_schema_test_class, **kwargs): # noqa: E501 + """test_body_with_file_schema # noqa: E501 + + For this test, the body for this request much reference a schema named `File`. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_file_schema(file_schema_test_class_file_schema_test_class, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param file_schema_test_class.FileSchemaTestClass file_schema_test_class_file_schema_test_class: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['file_schema_test_class_file_schema_test_class'] = \ + file_schema_test_class_file_schema_test_class + return self.call_with_http_info(**kwargs) + + self.test_body_with_file_schema = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-file-schema', + 'operation_id': 'test_body_with_file_schema', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'file_schema_test_class_file_schema_test_class', + ], + 'required': [ + 'file_schema_test_class_file_schema_test_class', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'file_schema_test_class_file_schema_test_class': + (file_schema_test_class.FileSchemaTestClass,), + }, + 'attribute_map': { + }, + 'location_map': { + 'file_schema_test_class_file_schema_test_class': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_file_schema + ) + + def __test_body_with_query_params(self, query, user_user, **kwargs): # noqa: E501 + """test_body_with_query_params # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_body_with_query_params(query, user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str query: (required) + :param user.User user_user: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['query'] = \ + query + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.test_body_with_query_params = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/body-with-query-params', + 'operation_id': 'test_body_with_query_params', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'query', + 'user_user', + ], + 'required': [ + 'query', + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'query': + (str,), + 'user_user': + (user.User,), + }, + 'attribute_map': { + 'query': 'query', + }, + 'location_map': { + 'query': 'query', + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_body_with_query_params + ) + + def __test_client_model(self, client_client, **kwargs): # noqa: E501 + """To test \"client\" model # noqa: E501 + + To test \"client\" model # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_client_model(client_client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param client.Client client_client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: client.Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client_client'] = \ + client_client + return self.call_with_http_info(**kwargs) + + self.test_client_model = Endpoint( + settings={ + 'response_type': (client.Client,), + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_client_model', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client_client', + ], + 'required': [ + 'client_client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client_client': + (client.Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client_client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_client_model + ) + + def __test_endpoint_parameters(self, number, double, pattern_without_delimiter, byte, **kwargs): # noqa: E501 + """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param float number: None (required) + :param float double: None (required) + :param str pattern_without_delimiter: None (required) + :param str byte: None (required) + :param int integer: None + :param int int32: None + :param int int64: None + :param float float: None + :param str string: None + :param file_type binary: None + :param date date: None + :param datetime date_time: None + :param str password: None + :param str param_callback: None + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['number'] = \ + number + kwargs['double'] = \ + double + kwargs['pattern_without_delimiter'] = \ + pattern_without_delimiter + kwargs['byte'] = \ + byte + return self.call_with_http_info(**kwargs) + + self.test_endpoint_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'http_basic_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_endpoint_parameters', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + 'integer', + 'int32', + 'int64', + 'float', + 'string', + 'binary', + 'date', + 'date_time', + 'password', + 'param_callback', + ], + 'required': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'byte', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'number', + 'double', + 'pattern_without_delimiter', + 'integer', + 'int32', + 'float', + 'string', + 'password', + ] + }, + root_map={ + 'validations': { + ('number',): { + + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + + 'inclusive_maximum': 987.6, + }, + ('string',): { + + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'number': + (float,), + 'double': + (float,), + 'pattern_without_delimiter': + (str,), + 'byte': + (str,), + 'integer': + (int,), + 'int32': + (int,), + 'int64': + (int,), + 'float': + (float,), + 'string': + (str,), + 'binary': + (file_type,), + 'date': + (date,), + 'date_time': + (datetime,), + 'password': + (str,), + 'param_callback': + (str,), + }, + 'attribute_map': { + 'number': 'number', + 'double': 'double', + 'pattern_without_delimiter': 'pattern_without_delimiter', + 'byte': 'byte', + 'integer': 'integer', + 'int32': 'int32', + 'int64': 'int64', + 'float': 'float', + 'string': 'string', + 'binary': 'binary', + 'date': 'date', + 'date_time': 'dateTime', + 'password': 'password', + 'param_callback': 'callback', + }, + 'location_map': { + 'number': 'form', + 'double': 'form', + 'pattern_without_delimiter': 'form', + 'byte': 'form', + 'integer': 'form', + 'int32': 'form', + 'int64': 'form', + 'float': 'form', + 'string': 'form', + 'binary': 'form', + 'date': 'form', + 'date_time': 'form', + 'password': 'form', + 'param_callback': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_endpoint_parameters + ) + + def __test_enum_parameters(self, **kwargs): # noqa: E501 + """To test enum parameters # noqa: E501 + + To test enum parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_enum_parameters(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] enum_header_string_array: Header parameter enum test (string array) + :param str enum_header_string: Header parameter enum test (string) + :param [str] enum_query_string_array: Query parameter enum test (string array) + :param str enum_query_string: Query parameter enum test (string) + :param int enum_query_integer: Query parameter enum test (double) + :param float enum_query_double: Query parameter enum test (double) + :param [str] enum_form_string_array: Form parameter enum test (string array) + :param str enum_form_string: Form parameter enum test (string) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.test_enum_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake', + 'operation_id': 'test_enum_parameters', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'enum_header_string_array', + 'enum_header_string', + 'enum_query_string_array', + 'enum_query_string', + 'enum_query_integer', + 'enum_query_double', + 'enum_form_string_array', + 'enum_form_string', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('enum_header_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_header_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_query_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + ('enum_query_integer',): { + + "1": 1, + "-2": -2 + }, + ('enum_query_double',): { + + "1.1": 1.1, + "-1.2": -1.2 + }, + ('enum_form_string_array',): { + + ">": ">", + "$": "$" + }, + ('enum_form_string',): { + + "_ABC": "_abc", + "-EFG": "-efg", + "(XYZ)": "(xyz)" + }, + }, + 'openapi_types': { + 'enum_header_string_array': + ([str],), + 'enum_header_string': + (str,), + 'enum_query_string_array': + ([str],), + 'enum_query_string': + (str,), + 'enum_query_integer': + (int,), + 'enum_query_double': + (float,), + 'enum_form_string_array': + ([str],), + 'enum_form_string': + (str,), + }, + 'attribute_map': { + 'enum_header_string_array': 'enum_header_string_array', + 'enum_header_string': 'enum_header_string', + 'enum_query_string_array': 'enum_query_string_array', + 'enum_query_string': 'enum_query_string', + 'enum_query_integer': 'enum_query_integer', + 'enum_query_double': 'enum_query_double', + 'enum_form_string_array': 'enum_form_string_array', + 'enum_form_string': 'enum_form_string', + }, + 'location_map': { + 'enum_header_string_array': 'header', + 'enum_header_string': 'header', + 'enum_query_string_array': 'query', + 'enum_query_string': 'query', + 'enum_query_integer': 'query', + 'enum_query_double': 'query', + 'enum_form_string_array': 'form', + 'enum_form_string': 'form', + }, + 'collection_format_map': { + 'enum_header_string_array': 'csv', + 'enum_query_string_array': 'multi', + 'enum_form_string_array': 'csv', + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_enum_parameters + ) + + def __test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501 + """Fake endpoint to test group parameters (optional) # noqa: E501 + + Fake endpoint to test group parameters (optional) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int required_string_group: Required String in group parameters (required) + :param bool required_boolean_group: Required Boolean in group parameters (required) + :param int required_int64_group: Required Integer in group parameters (required) + :param int string_group: String in group parameters + :param bool boolean_group: Boolean in group parameters + :param int int64_group: Integer in group parameters + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['required_string_group'] = \ + required_string_group + kwargs['required_boolean_group'] = \ + required_boolean_group + kwargs['required_int64_group'] = \ + required_int64_group + return self.call_with_http_info(**kwargs) + + self.test_group_parameters = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'bearer_test' + ], + 'endpoint_path': '/fake', + 'operation_id': 'test_group_parameters', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + 'string_group', + 'boolean_group', + 'int64_group', + ], + 'required': [ + 'required_string_group', + 'required_boolean_group', + 'required_int64_group', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'required_string_group': + (int,), + 'required_boolean_group': + (bool,), + 'required_int64_group': + (int,), + 'string_group': + (int,), + 'boolean_group': + (bool,), + 'int64_group': + (int,), + }, + 'attribute_map': { + 'required_string_group': 'required_string_group', + 'required_boolean_group': 'required_boolean_group', + 'required_int64_group': 'required_int64_group', + 'string_group': 'string_group', + 'boolean_group': 'boolean_group', + 'int64_group': 'int64_group', + }, + 'location_map': { + 'required_string_group': 'query', + 'required_boolean_group': 'header', + 'required_int64_group': 'query', + 'string_group': 'query', + 'boolean_group': 'header', + 'int64_group': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_group_parameters + ) + + def __test_inline_additional_properties(self, request_body, **kwargs): # noqa: E501 + """test inline additionalProperties # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_inline_additional_properties(request_body, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param {str: (str,)} request_body: request body (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['request_body'] = \ + request_body + return self.call_with_http_info(**kwargs) + + self.test_inline_additional_properties = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/inline-additionalProperties', + 'operation_id': 'test_inline_additional_properties', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'request_body', + ], + 'required': [ + 'request_body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'request_body': + ({str: (str,)},), + }, + 'attribute_map': { + }, + 'location_map': { + 'request_body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_inline_additional_properties + ) + + def __test_json_form_data(self, param, param2, **kwargs): # noqa: E501 + """test json serialization of form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_json_form_data(param, param2, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str param: field1 (required) + :param str param2: field2 (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['param'] = \ + param + kwargs['param2'] = \ + param2 + return self.call_with_http_info(**kwargs) + + self.test_json_form_data = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/jsonFormData', + 'operation_id': 'test_json_form_data', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'param', + 'param2', + ], + 'required': [ + 'param', + 'param2', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'param': + (str,), + 'param2': + (str,), + }, + 'attribute_map': { + 'param': 'param', + 'param2': 'param2', + }, + 'location_map': { + 'param': 'form', + 'param2': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__test_json_form_data + ) + + def __test_query_parameter_collection_format(self, pipe, ioutil, http, url, context, **kwargs): # noqa: E501 + """test_query_parameter_collection_format # noqa: E501 + + To test the collection format in query parameters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_query_parameter_collection_format(pipe, ioutil, http, url, context, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] pipe: (required) + :param [str] ioutil: (required) + :param [str] http: (required) + :param [str] url: (required) + :param [str] context: (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pipe'] = \ + pipe + kwargs['ioutil'] = \ + ioutil + kwargs['http'] = \ + http + kwargs['url'] = \ + url + kwargs['context'] = \ + context + return self.call_with_http_info(**kwargs) + + self.test_query_parameter_collection_format = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/fake/test-query-paramters', + 'operation_id': 'test_query_parameter_collection_format', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'required': [ + 'pipe', + 'ioutil', + 'http', + 'url', + 'context', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pipe': + ([str],), + 'ioutil': + ([str],), + 'http': + ([str],), + 'url': + ([str],), + 'context': + ([str],), + }, + 'attribute_map': { + 'pipe': 'pipe', + 'ioutil': 'ioutil', + 'http': 'http', + 'url': 'url', + 'context': 'context', + }, + 'location_map': { + 'pipe': 'query', + 'ioutil': 'query', + 'http': 'query', + 'url': 'query', + 'context': 'query', + }, + 'collection_format_map': { + 'pipe': 'multi', + 'ioutil': 'csv', + 'http': 'space', + 'url': 'csv', + 'context': 'multi', + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__test_query_parameter_collection_format + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py new file mode 100644 index 000000000000..90da061d2d9a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -0,0 +1,380 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import client + + +class FakeClassnameTags123Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __test_classname(self, client_client, **kwargs): # noqa: E501 + """To test class name in snake case # noqa: E501 + + To test class name in snake case # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.test_classname(client_client, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param client.Client client_client: client model (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: client.Client + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['client_client'] = \ + client_client + return self.call_with_http_info(**kwargs) + + self.test_classname = Endpoint( + settings={ + 'response_type': (client.Client,), + 'auth': [ + 'api_key_query' + ], + 'endpoint_path': '/fake_classname_test', + 'operation_id': 'test_classname', + 'http_method': 'PATCH', + 'servers': [], + }, + params_map={ + 'all': [ + 'client_client', + ], + 'required': [ + 'client_client', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'client_client': + (client.Client,), + }, + 'attribute_map': { + }, + 'location_map': { + 'client_client': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__test_classname + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py new file mode 100644 index 000000000000..9d890ef25f2a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -0,0 +1,1319 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import pet +from petstore_api.models import api_response + + +class PetApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __add_pet(self, pet_pet, **kwargs): # noqa: E501 + """Add a new pet to the store # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.add_pet(pet_pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param pet.Pet pet_pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_pet'] = \ + pet_pet + return self.call_with_http_info(**kwargs) + + self.add_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'add_pet', + 'http_method': 'POST', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet_pet', + ], + 'required': [ + 'pet_pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_pet': + (pet.Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet_pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__add_pet + ) + + def __delete_pet(self, pet_id, **kwargs): # noqa: E501 + """Deletes a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_pet(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: Pet id to delete (required) + :param str api_key: + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.delete_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'delete_pet', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'api_key', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'api_key': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'api_key': 'api_key', + }, + 'location_map': { + 'pet_id': 'path', + 'api_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_pet + ) + + def __find_pets_by_status(self, status, **kwargs): # noqa: E501 + """Finds Pets by status # noqa: E501 + + Multiple status values can be provided with comma separated strings # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_status(status, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] status: Status values that need to be considered for filter (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [pet.Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['status'] = \ + status + return self.call_with_http_info(**kwargs) + + self.find_pets_by_status = Endpoint( + settings={ + 'response_type': ([pet.Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByStatus', + 'operation_id': 'find_pets_by_status', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'status', + ], + 'required': [ + 'status', + ], + 'nullable': [ + ], + 'enum': [ + 'status', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('status',): { + + "AVAILABLE": "available", + "PENDING": "pending", + "SOLD": "sold" + }, + }, + 'openapi_types': { + 'status': + ([str],), + }, + 'attribute_map': { + 'status': 'status', + }, + 'location_map': { + 'status': 'query', + }, + 'collection_format_map': { + 'status': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_status + ) + + def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 + """Finds Pets by tags # noqa: E501 + + Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.find_pets_by_tags(tags, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [str] tags: Tags to filter by (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: [pet.Pet] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['tags'] = \ + tags + return self.call_with_http_info(**kwargs) + + self.find_pets_by_tags = Endpoint( + settings={ + 'response_type': ([pet.Pet],), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/findByTags', + 'operation_id': 'find_pets_by_tags', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'tags', + ], + 'required': [ + 'tags', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tags': + ([str],), + }, + 'attribute_map': { + 'tags': 'tags', + }, + 'location_map': { + 'tags': 'query', + }, + 'collection_format_map': { + 'tags': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__find_pets_by_tags + ) + + def __get_pet_by_id(self, pet_id, **kwargs): # noqa: E501 + """Find pet by ID # noqa: E501 + + Returns a single pet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_pet_by_id(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to return (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: pet.Pet + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.get_pet_by_id = Endpoint( + settings={ + 'response_type': (pet.Pet,), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'get_pet_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + }, + 'attribute_map': { + 'pet_id': 'petId', + }, + 'location_map': { + 'pet_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_pet_by_id + ) + + def __update_pet(self, pet_pet, **kwargs): # noqa: E501 + """Update an existing pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet(pet_pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param pet.Pet pet_pet: Pet object that needs to be added to the store (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_pet'] = \ + pet_pet + return self.call_with_http_info(**kwargs) + + self.update_pet = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet', + 'operation_id': 'update_pet', + 'http_method': 'PUT', + 'servers': [ + 'http://petstore.swagger.io/v2', + 'http://path-server-test.petstore.local/v2' + ] + }, + params_map={ + 'all': [ + 'pet_pet', + ], + 'required': [ + 'pet_pet', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_pet': + (pet.Pet,), + }, + 'attribute_map': { + }, + 'location_map': { + 'pet_pet': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json', + 'application/xml' + ] + }, + api_client=api_client, + callable=__update_pet + ) + + def __update_pet_with_form(self, pet_id, **kwargs): # noqa: E501 + """Updates a pet in the store with form data # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_pet_with_form(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.update_pet_with_form = Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}', + 'operation_id': 'update_pet_with_form', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'name', + 'status', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'name': + (str,), + 'status': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'name': 'name', + 'status': 'status', + }, + 'location_map': { + 'pet_id': 'path', + 'name': 'form', + 'status': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/x-www-form-urlencoded' + ] + }, + api_client=api_client, + callable=__update_pet_with_form + ) + + def __upload_file(self, pet_id, **kwargs): # noqa: E501 + """uploads an image # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file(pet_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file_type file: file to upload + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + return self.call_with_http_info(**kwargs) + + self.upload_file = Endpoint( + settings={ + 'response_type': (api_response.ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/pet/{petId}/uploadImage', + 'operation_id': 'upload_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'additional_metadata', + 'file', + ], + 'required': [ + 'pet_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'additional_metadata': + (str,), + 'file': + (file_type,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'additional_metadata': 'additionalMetadata', + 'file': 'file', + }, + 'location_map': { + 'pet_id': 'path', + 'additional_metadata': 'form', + 'file': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file + ) + + def __upload_file_with_required_file(self, pet_id, required_file, **kwargs): # noqa: E501 + """uploads an image (required) # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int pet_id: ID of pet to update (required) + :param file_type required_file: file to upload (required) + :param str additional_metadata: Additional data to pass to server + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: api_response.ApiResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['pet_id'] = \ + pet_id + kwargs['required_file'] = \ + required_file + return self.call_with_http_info(**kwargs) + + self.upload_file_with_required_file = Endpoint( + settings={ + 'response_type': (api_response.ApiResponse,), + 'auth': [ + 'petstore_auth' + ], + 'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile', + 'operation_id': 'upload_file_with_required_file', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'pet_id', + 'required_file', + 'additional_metadata', + ], + 'required': [ + 'pet_id', + 'required_file', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'pet_id': + (int,), + 'required_file': + (file_type,), + 'additional_metadata': + (str,), + }, + 'attribute_map': { + 'pet_id': 'petId', + 'required_file': 'requiredFile', + 'additional_metadata': 'additionalMetadata', + }, + 'location_map': { + 'pet_id': 'path', + 'required_file': 'form', + 'additional_metadata': 'form', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'multipart/form-data' + ] + }, + api_client=api_client, + callable=__upload_file_with_required_file + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py new file mode 100644 index 000000000000..c45745f3e529 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -0,0 +1,699 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import order + + +class StoreApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __delete_order(self, order_id, **kwargs): # noqa: E501 + """Delete purchase order by ID # noqa: E501 + + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_order(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str order_id: ID of the order that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.delete_order = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'delete_order', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': + (str,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_order + ) + + def __get_inventory(self, **kwargs): # noqa: E501 + """Returns pet inventories by status # noqa: E501 + + Returns a map of status codes to quantities # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_inventory(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: {str: (int,)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.get_inventory = Endpoint( + settings={ + 'response_type': ({str: (int,)},), + 'auth': [ + 'api_key' + ], + 'endpoint_path': '/store/inventory', + 'operation_id': 'get_inventory', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_inventory + ) + + def __get_order_by_id(self, order_id, **kwargs): # noqa: E501 + """Find purchase order by ID # noqa: E501 + + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_order_by_id(order_id, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param int order_id: ID of pet that needs to be fetched (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: order.Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_id'] = \ + order_id + return self.call_with_http_info(**kwargs) + + self.get_order_by_id = Endpoint( + settings={ + 'response_type': (order.Order,), + 'auth': [], + 'endpoint_path': '/store/order/{order_id}', + 'operation_id': 'get_order_by_id', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_id', + ], + 'required': [ + 'order_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'order_id', + ] + }, + root_map={ + 'validations': { + ('order_id',): { + + 'inclusive_maximum': 5, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_id': + (int,), + }, + 'attribute_map': { + 'order_id': 'order_id', + }, + 'location_map': { + 'order_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_order_by_id + ) + + def __place_order(self, order_order, **kwargs): # noqa: E501 + """Place an order for a pet # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_order(order_order, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param order.Order order_order: order placed for purchasing the pet (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: order.Order + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['order_order'] = \ + order_order + return self.call_with_http_info(**kwargs) + + self.place_order = Endpoint( + settings={ + 'response_type': (order.Order,), + 'auth': [], + 'endpoint_path': '/store/order', + 'operation_id': 'place_order', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'order_order', + ], + 'required': [ + 'order_order', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'order_order': + (order.Order,), + }, + 'attribute_map': { + }, + 'location_map': { + 'order_order': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__place_order + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py new file mode 100644 index 000000000000..141520baa7e5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -0,0 +1,1130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 +import sys # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from petstore_api.api_client import ApiClient +from petstore_api.exceptions import ( + ApiTypeError, + ApiValueError +) +from petstore_api.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + int, + none_type, + str, + validate_and_convert_types +) +from petstore_api.models import user + + +class UserApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __create_user(self, user_user, **kwargs): # noqa: E501 + """Create user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_user(user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param user.User user_user: Created user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.create_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user', + 'operation_id': 'create_user', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user_user', + ], + 'required': [ + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user_user': + (user.User,), + }, + 'attribute_map': { + }, + 'location_map': { + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_user + ) + + def __create_users_with_array_input(self, user_user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_array_input(user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [user.User] user_user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.create_users_with_array_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithArray', + 'operation_id': 'create_users_with_array_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user_user', + ], + 'required': [ + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user_user': + ([user.User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_array_input + ) + + def __create_users_with_list_input(self, user_user, **kwargs): # noqa: E501 + """Creates list of users with given input array # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_users_with_list_input(user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param [user.User] user_user: List of user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.create_users_with_list_input = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/createWithList', + 'operation_id': 'create_users_with_list_input', + 'http_method': 'POST', + 'servers': [], + }, + params_map={ + 'all': [ + 'user_user', + ], + 'required': [ + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user_user': + ([user.User],), + }, + 'attribute_map': { + }, + 'location_map': { + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_users_with_list_input + ) + + def __delete_user(self, username, **kwargs): # noqa: E501 + """Delete user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_user(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be deleted (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.delete_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'delete_user', + 'http_method': 'DELETE', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__delete_user + ) + + def __get_user_by_name(self, username, **kwargs): # noqa: E501 + """Get user by user name # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_by_name(username, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: user.User + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + return self.call_with_http_info(**kwargs) + + self.get_user_by_name = Endpoint( + settings={ + 'response_type': (user.User,), + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'get_user_by_name', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + ], + 'required': [ + 'username', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_user_by_name + ) + + def __login_user(self, username, password, **kwargs): # noqa: E501 + """Logs user into the system # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.login_user(username, password, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: The user name for login (required) + :param str password: The password for login in clear text (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: str + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + kwargs['password'] = \ + password + return self.call_with_http_info(**kwargs) + + self.login_user = Endpoint( + settings={ + 'response_type': (str,), + 'auth': [], + 'endpoint_path': '/user/login', + 'operation_id': 'login_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'password', + ], + 'required': [ + 'username', + 'password', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + 'password': + (str,), + }, + 'attribute_map': { + 'username': 'username', + 'password': 'password', + }, + 'location_map': { + 'username': 'query', + 'password': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/xml', + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__login_user + ) + + def __logout_user(self, **kwargs): # noqa: E501 + """Logs out current logged in user session # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.logout_user(async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + return self.call_with_http_info(**kwargs) + + self.logout_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/logout', + 'operation_id': 'logout_user', + 'http_method': 'GET', + 'servers': [], + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client, + callable=__logout_user + ) + + def __update_user(self, username, user_user, **kwargs): # noqa: E501 + """Updated user # noqa: E501 + + This can only be done by the logged in user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_user(username, user_user, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + Default is False. + :param str username: name that need to be deleted (required) + :param user.User user_user: Updated user object (required) + :param _return_http_data_only: response data without head status + code and headers. Default is True. + :param _preload_content: if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + :param _check_input_type: boolean specifying if type checking + should be done one the data sent to the server. + Default is True. + :param _check_return_type: boolean specifying if type checking + should be done one the data received from the server. + Default is True. + :param _host_index: integer specifying the index of the server + that we want to use. + Default is 0. + :return: None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index', 0) + kwargs['username'] = \ + username + kwargs['user_user'] = \ + user_user + return self.call_with_http_info(**kwargs) + + self.update_user = Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/user/{username}', + 'operation_id': 'update_user', + 'http_method': 'PUT', + 'servers': [], + }, + params_map={ + 'all': [ + 'username', + 'user_user', + ], + 'required': [ + 'username', + 'user_user', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'username': + (str,), + 'user_user': + (user.User,), + }, + 'attribute_map': { + 'username': 'username', + }, + 'location_map': { + 'username': 'path', + 'user_user': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__update_user + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (int,), + '_preload_content': (bool,), + '_request_timeout': (none_type, int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param] + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in six.iteritems(kwargs): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + False, + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in six.iteritems(kwargs): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][param_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][param_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + pet_api = PetApi() + pet_api.add_pet # this is an instance of the class Endpoint + pet_api.add_pet() # this invokes pet_api.add_pet.__call__() + which then invokes the callable functions stored in that endpoint at + pet_api.add_pet.callable or self.callable in this class + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + _host = self.settings['servers'][kwargs['_host_index']] + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in six.iteritems(kwargs): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py new file mode 100644 index 000000000000..d3e808ddf40b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -0,0 +1,535 @@ +# coding: utf-8 +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from petstore_api import rest +from petstore_api.configuration import Configuration +from petstore_api.exceptions import ApiValueError +from petstore_api.model_utils import ( + ModelNormal, + ModelSimple, + date, + datetime, + deserialize_file, + file_type, + model_to_dict, + str, + validate_and_convert_types +) + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + # six.binary_type python2=str, python3=bytes + # six.text_type python2=unicode, python3=str + PRIMITIVE_TYPES = ( + (float, bool, six.binary_type, six.text_type) + six.integer_types + ) + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + + def __del__(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + elif isinstance(obj, ModelNormal): + # Convert model obj to dict + # Convert attribute name to json key in + # model definition for request + obj_dict = model_to_dict(obj, serialize=True) + elif isinstance(obj, ModelSimple): + return self.sanitize_for_serialization(obj.value) + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type, _check_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param _check_type: boolean, whether to check the types of the data + received from the server + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == (file_type,): + content_disposition = response.getheader("Content-Disposition") + return deserialize_file(response.data, self.configuration, + content_disposition=content_disposition) + + # fetch data from response object + try: + received_data = json.loads(response.data) + except ValueError: + received_data = response.data + + # store our data under the key of 'received_data' so users have some + # context if they are deserializing a string and the data type is wrong + deserialized_data = validate_and_convert_types( + received_data, + response_type, + ['received_data'], + True, + _check_type, + configuration=self.configuration + ) + return deserialized_data + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _check_type=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param files dict: key -> field name, value -> a list of open file + objects for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _check_type: boolean describing if the data back from the server + should have its type checked. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _check_type) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: None or a dict with key=param_name and + value is a list of open file objects + :return: List of tuples of form parameters with file data + """ + if files is None: + return [] + + params = [] + for param_name, file_instances in six.iteritems(files): + if file_instances is None: + # if the file field is nullable, skip None values + continue + for file_instance in file_instances: + if file_instance is None: + # if the file field is nullable, skip None values + continue + if file_instance.closed is True: + raise ApiValueError( + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name + ) + filename = os.path.basename(file_instance.name) + filedata = file_instance.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([param_name, tuple([filename, filedata, mimetype])])) + file_instance.close() + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py new file mode 100644 index 000000000000..60cb525776a5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -0,0 +1,406 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + + :Example: + + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + conf = petstore_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + def __init__(self, host="http://petstore.swagger.io:80/v2", + api_key=None, api_key_prefix=None, + username=None, password=None): + """Constructor + """ + self.host = host + """Default Base url + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = "" + """access token for OAuth/Bearer + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("petstore_api") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = None + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Disable client side validation + self.client_side_validation = True + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'api_key' in self.api_key: + auth['api_key'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'api_key', + 'value': self.get_api_key_with_prefix('api_key') + } + if 'api_key_query' in self.api_key: + auth['api_key_query'] = { + 'type': 'api_key', + 'in': 'query', + 'key': 'api_key_query', + 'value': self.get_api_key_with_prefix('api_key_query') + } + if self.access_token is not None: + auth['bearer_test'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + if self.username is not None and self.password is not None: + auth['http_basic_test'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + if self.access_token is not None: + auth['petstore_auth'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "http://{server}.swagger.io:{port}/v2", + 'description': "petstore server", + 'variables': { + 'server': { + 'description': "No description provided", + 'default_value': "petstore", + 'enum_values': [ + "petstore", + "qa-petstore", + "dev-petstore" + ] + }, + 'port': { + 'description': "No description provided", + 'default_value': "80", + 'enum_values': [ + "80", + "8080" + ] + } + } + }, + { + 'url': "https://localhost:8080/{version}", + 'description': "The local server", + 'variables': { + 'version': { + 'description': "No description provided", + 'default_value': "v2", + 'enum_values': [ + "v1", + "v2" + ] + } + } + } + ] + + def get_host_from_settings(self, index, variables=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :return: URL based on host settings + """ + variables = {} if variables is None else variables + servers = self.get_host_settings() + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server['variables'].items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py new file mode 100644 index 000000000000..100be3e0540f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/exceptions.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py new file mode 100644 index 000000000000..6d6a88edb7eb --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -0,0 +1,1393 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from datetime import date, datetime # noqa: F401 +import inspect +import os +import pprint +import re +import tempfile + +from dateutil.parser import parse +import six + +from petstore_api.exceptions import ( + ApiKeyError, + ApiTypeError, + ApiValueError, +) + +none_type = type(None) +if six.PY3: + import io + file_type = io.IOBase + # these are needed for when other modules import str and int from here + str = str + int = int +else: + file_type = file # noqa: F821 + str_py2 = str + unicode_py2 = unicode # noqa: F821 + long_py2 = long # noqa: F821 + int_py2 = int + # this requires that the future library is installed + from builtins import int, str + + +class OpenApiModel(object): + """The base class for all OpenAPIModels""" + + def set_attribute(self, name, value): + # this is only used to set properties on self + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + openapi_types = self.openapi_types() + if name in openapi_types: + required_types_mixed = openapi_types[name] + elif self.additional_properties_type is None: + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._from_server, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value + ) + self.__dict__['_data_store'][name] = value + + def __setitem__(self, name, value): + """this allows us to set values with instance[field_name] = val""" + self.__setattr__(name, value) + + def __getitem__(self, name): + """this allows us to get a value with val = instance[field_name]""" + return self.__getattr__(name) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other + + +class ModelSimple(OpenApiModel): + """the parent class of models whose type != object in their + swagger/openapi""" + + def __setattr__(self, name, value): + """this allows us to set a value with instance.field_name = val""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def __getattr__(self, name): + """this allows us to get a value with val = instance.field_name""" + if name in self.required_properties: + return self.__dict__[name] + + if name in self.__dict__['_data_store']: + return self.__dict__['_data_store'][name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not six.PY3 and len(types) == 2 and unicode in types: # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + +class ModelNormal(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi""" + + def __setattr__(self, name, value): + """this allows us to set a value with instance.field_name = val""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def __getattr__(self, name): + """this allows us to get a value with val = instance.field_name""" + if name in self.required_properties: + return self.__dict__[name] + + if name in self.__dict__['_data_store']: + return self.__dict__['_data_store'][name] + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + [name] + ) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + +class ModelComposed(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi and have oneOf/allOf/anyOf""" + + def __setattr__(self, name, value): + """this allows us to set a value with instance.field_name = val""" + if name in self.required_properties: + self.__dict__[name] = value + return + + # set the attribute on the correct instance + model_instances = self._var_name_to_model_instances.get( + name, self._additional_properties_model_instances) + if model_instances: + for model_instance in model_instances: + if model_instance == self: + self.set_attribute(name, value) + else: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = ( + model_instance + ) + return None + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + + def __getattr__(self, name): + """this allows us to get a value with val = instance.field_name""" + if name in self.required_properties: + return self.__dict__[name] + + # get the attribute from the correct instance + model_instances = self._var_name_to_model_instances.get( + name, self._additional_properties_model_instances) + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + if model_instances: + values = set() + for model_instance in model_instances: + if name in model_instance._data_store: + values.add(model_instance._data_store[name]) + if len(values) == 1: + return list(values)[0] + raise ApiValueError( + "Values stored for property {0} in {1} difffer when looking " + "at self and self's composed instances. All values must be " + "the same".format(name, type(self).__name__), + path_to_item + ) + + raise ApiKeyError( + "{0} has no key '{1}'".format(type(self).__name__, name), + path_to_item + ) + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in six.iteritems(self._data_store): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if (not six.PY3 and + len(types) == 2 and unicode in types): # noqa: F821 + vals_equal = ( + this_val.encode('utf-8') == that_val.encode('utf-8') + ) + if not vals_equal: + return False + return True + + +COERCION_INDEX_BY_TYPE = { + ModelComposed: 0, + ModelNormal: 1, + ModelSimple: 2, + none_type: 3, + list: 4, + dict: 5, + float: 6, + int: 7, + bool: 8, + datetime: 9, + date: 10, + str: 11, + file_type: 12, +} + +# these are used to limit what type conversions we try to do +# when we have a valid type already and we want to try converting +# to another type +UPCONVERSION_TYPE_PAIRS = ( + (str, datetime), + (str, date), + (list, ModelComposed), + (dict, ModelComposed), + (list, ModelNormal), + (dict, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), +) + +COERCIBLE_TYPE_PAIRS = { + False: ( # client instantiation of a model with client data + # (dict, ModelComposed), + # (list, ModelComposed), + # (dict, ModelNormal), + # (list, ModelNormal), + # (str, ModelSimple), + # (int, ModelSimple), + # (float, ModelSimple), + # (list, ModelSimple), + # (str, int), + # (str, float), + # (str, datetime), + # (str, date), + # (int, str), + # (float, str), + ), + True: ( # server -> client data + (dict, ModelComposed), + (list, ModelComposed), + (dict, ModelNormal), + (list, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), + # (str, int), + # (str, float), + (str, datetime), + (str, date), + # (int, str), + # (float, str), + (str, file_type) + ), +} + + +def get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + Python2: + float and int will return int, where int is the python3 int backport + str and unicode will return str, where str is the python3 str backport + Note: float and int ARE both instances of int backport + Note: str_py2 and unicode_py2 are NOT both instances of str backport + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, type): + # input_value is a class + return input_value + elif isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, list): + return list + elif isinstance(input_value, dict): + return dict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, file_type): + return file_type + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + # for python2 input_value==long_instance -> return int + # where int is the python3 int backport + return int + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif (six.PY2 and isinstance(input_value, (str_py2, unicode_py2, str)) or + isinstance(input_value, str)): + return str + return type(input_value) + + +def check_allowed_values(allowed_values, input_variable_path, input_values): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + """ + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def check_validations(validations, input_variable_path, input_values): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking + """ + current_validations = validations[input_variable_path] + if ('max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if ('min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if ('max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if ('min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum') + if (any(item in current_validations for item in items)): + if isinstance(input_values, list): + max_val = max(input_values) + min_val = min(input_values) + elif isinstance(input_values, dict): + max_val = max(input_values.values()) + min_val = min(input_values.values()) + else: + max_val = input_values + min_val = input_values + + if ('exclusive_maximum' in current_validations and + max_val >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_maximum' in current_validations and + max_val > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if ('exclusive_minimum' in current_validations and + min_val <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if ('inclusive_minimum' in current_validations and + min_val < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if ('regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + raise ApiValueError( + r"Invalid value for `%s`, must be a follow pattern or equal to " + r"`%s` with flags=`%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'], + flags + ) + ) + + +def order_response_types(required_types): + """Returns the required types sorted in coercion order + + Args: + required_types (list/tuple): collection of classes or instance of + list or dict with classs information inside it + + Returns: + (list): coercion order sorted collection of classes or instance + of list or dict with classs information inside it + """ + + def index_getter(class_or_instance): + if isinstance(class_or_instance, list): + return COERCION_INDEX_BY_TYPE[list] + elif isinstance(class_or_instance, dict): + return COERCION_INDEX_BY_TYPE[dict] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelComposed)): + return COERCION_INDEX_BY_TYPE[ModelComposed] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelNormal)): + return COERCION_INDEX_BY_TYPE[ModelNormal] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelSimple)): + return COERCION_INDEX_BY_TYPE[ModelSimple] + return COERCION_INDEX_BY_TYPE[class_or_instance] + + sorted_types = sorted( + required_types, + key=lambda class_or_instance: index_getter(class_or_instance) + ) + return sorted_types + + +def remove_uncoercible(required_types_classes, current_item, from_server, + must_convert=True): + """Only keeps the type conversions that are possible + + Args: + required_types_classes (tuple): tuple of classes that are required + these should be ordered by COERCION_INDEX_BY_TYPE + from_server (bool): a boolean of whether the data is from the server + if false, the data is from the client + current_item (any): the current item to be converted + + Keyword Args: + must_convert (bool): if True the item to convert is of the wrong + type and we want a big list of coercibles + if False, we want a limited list of coercibles + + Returns: + (list): the remaining coercible required types, classes only + """ + current_type_simple = get_simple_class(current_item) + + results_classes = [] + for required_type_class in required_types_classes: + # convert our models to OpenApiModel + required_type_class_simplified = required_type_class + if isinstance(required_type_class_simplified, type): + if issubclass(required_type_class_simplified, ModelComposed): + required_type_class_simplified = ModelComposed + elif issubclass(required_type_class_simplified, ModelNormal): + required_type_class_simplified = ModelNormal + elif issubclass(required_type_class_simplified, ModelSimple): + required_type_class_simplified = ModelSimple + + if required_type_class_simplified == current_type_simple: + # don't consider converting to one's own class + continue + + class_pair = (current_type_simple, required_type_class_simplified) + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: + results_classes.append(required_type_class) + elif class_pair in UPCONVERSION_TYPE_PAIRS: + results_classes.append(required_type_class) + return results_classes + + +def get_required_type_classes(required_types_mixed): + """Converts the tuple required_types into a tuple and a dict described + below + + Args: + required_types_mixed (tuple/list): will contain either classes or + instance of list or dict + + Returns: + (valid_classes, dict_valid_class_to_child_types_mixed): + valid_classes (tuple): the valid classes that the current item + should be + dict_valid_class_to_child_types_mixed (doct): + valid_class (class): this is the key + child_types_mixed (list/dict/tuple): describes the valid child + types + """ + valid_classes = [] + child_req_types_by_current_type = {} + for required_type in required_types_mixed: + if isinstance(required_type, list): + valid_classes.append(list) + child_req_types_by_current_type[list] = required_type + elif isinstance(required_type, tuple): + valid_classes.append(tuple) + child_req_types_by_current_type[tuple] = required_type + elif isinstance(required_type, dict): + valid_classes.append(dict) + child_req_types_by_current_type[dict] = required_type[str] + else: + valid_classes.append(required_type) + return tuple(valid_classes), child_req_types_by_current_type + + +def change_keys_js_to_python(input_dict, model_class): + """ + Converts from javascript_key keys in the input_dict to python_keys in + the output dict using the mapping in model_class + """ + + output_dict = {} + reversed_attr_map = {value: key for key, value in + six.iteritems(model_class.attribute_map)} + for javascript_key, value in six.iteritems(input_dict): + python_key = reversed_attr_map.get(javascript_key) + if python_key is None: + # if the key is unknown, it is in error or it is an + # additionalProperties variable + python_key = javascript_key + output_dict[python_key] = value + return output_dict + + +def get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type + ) + + +def deserialize_primitive(data, klass, path_to_item): + """Deserializes string to primitive type. + + :param data: str/int/float + :param klass: str/class the class to convert to + + :return: int, float, str, bool, date, datetime + """ + additional_message = "" + try: + if klass in {datetime, date}: + additional_message = ( + "If you need your parameter to have a fallback " + "string value, please set its type as `type: {}` in your " + "spec. That allows the value to be any type. " + ) + if klass == datetime: + if len(data) < 8: + raise ValueError("This is not a datetime") + # The string should be in iso8601 datetime format. + parsed_datetime = parse(data) + date_only = ( + parsed_datetime.hour == 0 and + parsed_datetime.minute == 0 and + parsed_datetime.second == 0 and + parsed_datetime.tzinfo is None and + 8 <= len(data) <= 10 + ) + if date_only: + raise ValueError("This is a date, not a datetime") + return parsed_datetime + elif klass == date: + if len(data) < 8: + raise ValueError("This is not a date") + return parse(data).date() + else: + converted_value = klass(data) + if isinstance(data, str) and klass == float: + if str(converted_value) != data: + # '7' -> 7.0 -> '7.0' != '7' + raise ValueError('This is not a float') + return converted_value + except (OverflowError, ValueError): + # parse can raise OverflowError + raise ApiValueError( + "{0}Failed to parse {1} as {2}".format( + additional_message, repr(data), get_py3_class_name(klass) + ), + path_to_item=path_to_item + ) + + +def fix_model_input_data(model_data, model_class): + # this is only called on classes where the input data is a dict + fixed_model_data = change_keys_js_to_python( + model_data, + model_class + ) + if model_class._composed_schemas() is not None: + for allof_class in model_class._composed_schemas()['allOf']: + fixed_model_data = change_keys_js_to_python( + fixed_model_data, + allof_class + ) + return fixed_model_data + + +def deserialize_model(model_data, model_class, path_to_item, check_type, + configuration, from_server): + """Deserializes model_data to model instance. + + Args: + model_data (list/dict): data to instantiate the model + model_class (OpenApiModel): the model class + path_to_item (list): path to the model in the received data + check_type (bool): whether to check the data tupe for the values in + the model + configuration (Configuration): the instance to use to convert files + from_server (bool): True if the data is from the server + False if the data is from the client + + Returns: + model instance + + Raise: + ApiTypeError + ApiValueError + ApiKeyError + """ + + kw_args = dict(_check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _from_server=from_server) + + used_model_class = model_class + if model_class.discriminator() is not None: + used_model_class = model_class.get_discriminator_class( + from_server, model_data) + + if issubclass(used_model_class, ModelSimple): + instance = used_model_class(value=model_data, **kw_args) + return instance + if isinstance(model_data, list): + instance = used_model_class(*model_data, **kw_args) + if isinstance(model_data, dict): + fixed_model_data = change_keys_js_to_python( + model_data, + used_model_class + ) + kw_args.update(fixed_model_data) + instance = used_model_class(**kw_args) + return instance + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if six.PY3 and isinstance(response_data, str): + # in python3 change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +def attempt_convert_item(input_value, valid_classes, path_to_item, + configuration, from_server, key_type=False, + must_convert=False, check_type=True): + """ + Args: + input_value (any): the data to convert + valid_classes (any): the classes that are valid + path_to_item (list): the path to the item to convert + configuration (Configuration): the instance to use to convert files + from_server (bool): True if data is from the server, False is data is + from the client + key_type (bool): if True we need to convert a key type (not supported) + must_convert (bool): if True we must convert + check_type (bool): if True we check the type or the returned data in + ModelComposed/ModelNormal/ModelSimple instances + + Returns: + instance (any) the fixed item + + Raises: + ApiTypeError + ApiValueError + ApiKeyError + """ + valid_classes_ordered = order_response_types(valid_classes) + valid_classes_coercible = remove_uncoercible( + valid_classes_ordered, input_value, from_server) + if not valid_classes_coercible or key_type: + # we do not handle keytype errors, json will take care + # of this for us + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=key_type) + for valid_class in valid_classes_coercible: + try: + if issubclass(valid_class, OpenApiModel): + return deserialize_model(input_value, valid_class, + path_to_item, check_type, + configuration, from_server) + elif valid_class == file_type: + return deserialize_file(input_value, configuration) + return deserialize_primitive(input_value, valid_class, + path_to_item) + except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: + if must_convert: + raise conversion_exc + # if we have conversion errors when must_convert == False + # we ignore the exception and move on to the next class + continue + # we were unable to convert, must_convert == False + return input_value + + +def validate_and_convert_types(input_value, required_types_mixed, path_to_item, + from_server, _check_type, configuration=None): + """Raises a TypeError is there is a problem, otherwise returns value + + Args: + input_value (any): the data to validate/convert + required_types_mixed (list/dict/tuple): A list of + valid classes, or a list tuples of valid classes, or a dict where + the value is a tuple of value classes + path_to_item: (list) the path to the data being validated + this stores a list of keys or indices to get to the data being + validated + from_server (bool): True if data is from the server + False if data is from the client + _check_type: (boolean) if true, type will be checked and conversion + will be attempted. + configuration: (Configuration): the configuration class to use + when converting file_type items. + If passed, conversion will be attempted when possible + If not passed, no conversions will be attempted and + exceptions will be raised + + Returns: + the correctly typed value + + Raises: + ApiTypeError + """ + results = get_required_type_classes(required_types_mixed) + valid_classes, child_req_types_by_current_type = results + + input_class_simple = get_simple_class(input_value) + valid_type = input_class_simple in set(valid_classes) + if not valid_type: + if configuration: + # if input_value is not valid_type try to convert it + converted_instance = attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=True + ) + return converted_instance + else: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=False) + + # input_value's type is in valid_classes + if len(valid_classes) > 1 and configuration: + # there are valid classes which are not the current class + valid_classes_coercible = remove_uncoercible( + valid_classes, input_value, from_server, must_convert=False) + if valid_classes_coercible: + converted_instance = attempt_convert_item( + input_value, + valid_classes_coercible, + path_to_item, + configuration, + from_server, + key_type=False, + must_convert=False + ) + return converted_instance + + if child_req_types_by_current_type == {}: + # all types are of the required types and there are no more inner + # variables left to look at + return input_value + inner_required_types = child_req_types_by_current_type.get( + type(input_value) + ) + if inner_required_types is None: + # for this type, there are not more inner variables left to look at + return input_value + if isinstance(input_value, list): + if input_value == []: + # allow an empty list + return input_value + for index, inner_value in enumerate(input_value): + inner_path = list(path_to_item) + inner_path.append(index) + input_value[index] = validate_and_convert_types( + inner_value, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + elif isinstance(input_value, dict): + if input_value == {}: + # allow an empty dict + return input_value + for inner_key, inner_val in six.iteritems(input_value): + inner_path = list(path_to_item) + inner_path.append(inner_key) + if get_simple_class(inner_key) != str: + raise get_type_error(inner_key, inner_path, valid_classes, + key_type=True) + input_value[inner_key] = validate_and_convert_types( + inner_val, + inner_required_types, + inner_path, + from_server, + _check_type, + configuration=configuration + ) + return input_value + + +def model_to_dict(model_instance, serialize=True): + """Returns the model properties as a dict + + Args: + model_instance (one of your model instances): the model instance that + will be converted to a dict. + + Keyword Args: + serialize (bool): if True, the keys in the dict will be values from + attribute_map + """ + result = {} + + model_instances = [model_instance] + if model_instance._composed_schemas() is not None: + model_instances = model_instance._composed_instances + for model_instance in model_instances: + for attr, value in six.iteritems(model_instance._data_store): + if serialize: + # we use get here because additional property key names do not + # exist in attribute_map + attr = model_instance.attribute_map.get(attr, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: model_to_dict(x, serialize=serialize) + if hasattr(x, '_data_store') else x, value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], + model_to_dict(item[1], serialize=serialize)) + if hasattr(item[1], '_data_store') else item, + value.items() + )) + elif hasattr(value, '_data_store'): + result[attr] = model_to_dict(value, serialize=serialize) + else: + result[attr] = value + + return result + + +def type_error_message(var_value=None, var_name=None, valid_classes=None, + key_type=None): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + """ + key_or_value = 'value' + if key_type: + key_or_value = 'key' + valid_classes_phrase = get_valid_classes_phrase(valid_classes) + msg = ( + "Invalid type for variable '{0}'. Required {1} type {2} and " + "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + ) + return msg + + +def get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed + Note: Adds the extra valid classes in python2 + """ + all_classes = list(input_classes) + if six.PY2 and str in input_classes: + all_classes.extend([str_py2, unicode_py2]) + if six.PY2 and int in input_classes: + all_classes.extend([int_py2, long_py2]) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return 'is {0}'.format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def get_py3_class_name(input_class): + if six.PY2: + if input_class == str: + return 'str' + elif input_class == int: + return 'int' + return input_class.__name__ + + +def get_allof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): var_name to var_value + used to make instances + + Returns + composed_instances (list) + """ + composed_instances = [] + for allof_class in self._composed_schemas()['allOf']: + + # transform js keys to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_args, allof_class) + + # extract a dict of only required keys from fixed_model_args + kwargs = {} + var_names = set(allof_class.openapi_types().keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # and use it to make the instance + kwargs.update(constant_args) + allof_instance = allof_class(**kwargs) + composed_instances.append(allof_instance) + return composed_instances + + +def get_oneof_instance(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): var_name to var_value + used to make instances + + Returns + oneof_instance (instance) + """ + oneof_instance = None + if len(self._composed_schemas()['oneOf']) == 0: + return oneof_instance + + for oneof_class in self._composed_schemas()['oneOf']: + # transform js keys to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python( + model_args, oneof_class) + + # extract a dict of only required keys from fixed_model_args + kwargs = {} + var_names = set(oneof_class.openapi_types().keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # and use it to make the instance + kwargs.update(constant_args) + try: + oneof_instance = oneof_class(**kwargs) + break + except Exception: + pass + if oneof_instance is None: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. Unable to " + "make any instances of the classes in oneOf definition." % + self.__class__.__name__ + ) + return oneof_instance + + +def get_anyof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): var_name to var_value + used to make instances + + Returns + anyof_instances (list) + """ + anyof_instances = [] + if len(self._composed_schemas()['anyOf']) == 0: + return anyof_instances + + for anyof_class in self._composed_schemas()['anyOf']: + # transform js keys to python keys in fixed_model_args + fixed_model_args = change_keys_js_to_python(model_args, anyof_class) + + # extract a dict of only required keys from these_model_vars + kwargs = {} + var_names = set(anyof_class.openapi_types().keys()) + for var_name in var_names: + if var_name in fixed_model_args: + kwargs[var_name] = fixed_model_args[var_name] + + # and use it to make the instance + kwargs.update(constant_args) + try: + anyof_instance = anyof_class(**kwargs) + anyof_instances.append(anyof_instance) + except Exception: + pass + if len(anyof_instances) == 0: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. Unable to " + "make any instances of the classes in anyOf definition." % + self.__class__.__name__ + ) + return anyof_instances + + +def get_additional_properties_model_instances( + composed_instances, self): + additional_properties_model_instances = [] + all_instances = [self] + all_instances.extend(composed_instances) + for instance in all_instances: + if instance.additional_properties_type is not None: + additional_properties_model_instances.append(instance) + return additional_properties_model_instances + + +def get_var_name_to_model_instances(self, composed_instances): + var_name_to_model_instances = {} + all_instances = [self] + all_instances.extend(composed_instances) + for instance in all_instances: + for var_name in instance.openapi_types(): + if var_name not in var_name_to_model_instances: + var_name_to_model_instances[var_name] = [instance] + else: + var_name_to_model_instances[var_name].append(instance) + return var_name_to_model_instances + + +def get_unused_args(self, composed_instances, model_args): + unused_args = dict(model_args) + # arguments apssed to self were already converted to python names + # before __init__ was called + for var_name_py in self.attribute_map: + if var_name_py in unused_args: + del unused_args[var_name_py] + for instance in composed_instances: + if instance.__class__ in self._composed_schemas()['allOf']: + for var_name_py in instance.attribute_map: + if var_name_py in unused_args: + del unused_args[var_name_py] + else: + for var_name_js in instance.attribute_map.values(): + if var_name_js in unused_args: + del unused_args[var_name_js] + return unused_args + + +def validate_get_composed_info(constant_args, model_args, self): + """ + For composed schemas/classes, validates the classes to make sure that + they do not share any of the same parameters. If there is no collision + then composed model instances are created and returned tot the calling + self model + + Args: + constant_args (dict): these are the args that every model requires + model_args (dict): these are the required and optional spec args that + were passed in to make this model + self (class): the class that we are instantiating + This class contains self._composed_schemas() + + Returns: + composed_info (list): length three + composed_instances (list): the composed instances which are not + self + var_name_to_model_instances (dict): a dict going from var_name + to the model_instance which holds that var_name + the model_instance may be self or an instance of one of the + classes in self.composed_instances() + additional_properties_model_instances (list): a list of the + model instances which have the property + additional_properties_type. This list can include self + """ + # create composed_instances + composed_instances = [] + allof_instances = get_allof_instances(self, model_args, constant_args) + composed_instances.extend(allof_instances) + oneof_instance = get_oneof_instance(self, model_args, constant_args) + if oneof_instance is not None: + composed_instances.append(oneof_instance) + anyof_instances = get_anyof_instances(self, model_args, constant_args) + composed_instances.extend(anyof_instances) + + # map variable names to composed_instances + var_name_to_model_instances = get_var_name_to_model_instances( + self, composed_instances) + + # set additional_properties_model_instances + additional_properties_model_instances = ( + get_additional_properties_model_instances(composed_instances, self) + ) + + # set any remaining values + unused_args = get_unused_args(self, composed_instances, model_args) + if len(unused_args) > 0: + if len(additional_properties_model_instances) == 0: + raise ApiValueError( + "Invalid input arguments input when making an instance of " + "class %s. Not all inputs were used. The unused input data " + "is %s" % (self.__class__.__name__, unused_args) + ) + for var_name, var_value in six.iteritems(unused_args): + for instance in additional_properties_model_instances: + setattr(instance, var_name, var_value) + # no need to add additional_properties to var_name_to_model_instances here + # because additional_properties_model_instances will direct us to that + # instance when we use getattr or setattr + # and we update var_name_to_model_instances in setattr + + return [ + composed_instances, + var_name_to_model_instances, + additional_properties_model_instances + ] diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py new file mode 100644 index 000000000000..e02c66519259 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/__init__.py @@ -0,0 +1,15 @@ +# coding: utf-8 + +# flake8: noqa +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +# we can not import model classes here because that would create a circular +# reference which would not work in python2 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py new file mode 100644 index 000000000000..1539b694b560 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class AdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'map_property': ({str: (str,)},), # noqa: E501 + 'map_of_map_property': ({str: ({str: (str,)},)},), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'map_property': 'map_property', # noqa: E501 + 'map_of_map_property': 'map_of_map_property', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_property ({str: (str,)}): [optional] # noqa: E501 + map_of_map_property ({str: ({str: (str,)},)}): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py new file mode 100644 index 000000000000..abb0d49e74c9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import cat +except ImportError: + cat = sys.modules[ + 'petstore_api.models.cat'] +try: + from petstore_api.models import dog +except ImportError: + dog = sys.modules[ + 'petstore_api.models.dog'] + + +class Animal(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return { + 'class_name': { + 'Cat': cat.Cat, + 'Dog': dog.Dog, + }, + } + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """animal.Animal - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.class_name = class_name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py new file mode 100644 index 000000000000..cc3d2cea4424 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ApiResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'code': (int,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'code': 'code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """api_response.ApiResponse - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + code (int): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py new file mode 100644 index 000000000000..3c0175acdd81 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ArrayOfArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_array_number': ([[float]],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'array_array_number': 'ArrayArrayNumber', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_array_number ([[float]]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py new file mode 100644 index 000000000000..28bacd7021d8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ArrayOfNumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_number': ([float],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'array_number': 'ArrayNumber', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_number ([float]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py new file mode 100644 index 000000000000..c99bc985cab1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import read_only_first +except ImportError: + read_only_first = sys.modules[ + 'petstore_api.models.read_only_first'] + + +class ArrayTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'array_of_string': ([str],), # noqa: E501 + 'array_array_of_integer': ([[int]],), # noqa: E501 + 'array_array_of_model': ([[read_only_first.ReadOnlyFirst]],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'array_of_string': 'array_of_string', # noqa: E501 + 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 + 'array_array_of_model': 'array_array_of_model', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """array_test.ArrayTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + array_of_string ([str]): [optional] # noqa: E501 + array_array_of_integer ([[int]]): [optional] # noqa: E501 + array_array_of_model ([[read_only_first.ReadOnlyFirst]]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py new file mode 100644 index 000000000000..8311ed65ba20 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Capitalization(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'small_camel': (str,), # noqa: E501 + 'capital_camel': (str,), # noqa: E501 + 'small_snake': (str,), # noqa: E501 + 'capital_snake': (str,), # noqa: E501 + 'sca_eth_flow_points': (str,), # noqa: E501 + 'att_name': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'small_camel': 'smallCamel', # noqa: E501 + 'capital_camel': 'CapitalCamel', # noqa: E501 + 'small_snake': 'small_Snake', # noqa: E501 + 'capital_snake': 'Capital_Snake', # noqa: E501 + 'sca_eth_flow_points': 'SCA_ETH_Flow_Points', # noqa: E501 + 'att_name': 'ATT_NAME', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """capitalization.Capitalization - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + small_camel (str): [optional] # noqa: E501 + capital_camel (str): [optional] # noqa: E501 + small_snake (str): [optional] # noqa: E501 + capital_snake (str): [optional] # noqa: E501 + sca_eth_flow_points (str): [optional] # noqa: E501 + att_name (str): Name of the pet . [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py new file mode 100644 index 000000000000..229d04455540 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.models.animal'] +try: + from petstore_api.models import cat_all_of +except ImportError: + cat_all_of = sys.modules[ + 'petstore_api.models.cat_all_of'] + + +class Cat(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'declawed': (bool,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'declawed': 'declawed', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """cat.Cat - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_from_server': _from_server, + '_configuration': _configuration, + } + model_args = { + 'class_name': class_name, + } + model_args.update(kwargs) + composed_info = validate_get_composed_info( + constant_args, model_args, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + + self.class_name = class_name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) + + @staticmethod + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return { + 'anyOf': [ + ], + 'allOf': [ + animal.Animal, + cat_all_of.CatAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py new file mode 100644 index 000000000000..00b0cfae654b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class CatAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'declawed': (bool,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'declawed': 'declawed', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """cat_all_of.CatAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + declawed (bool): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py new file mode 100644 index 000000000000..2530a19b2f32 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Category(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'id': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'id': 'id', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, name='default-name', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """category.Category - a model defined in OpenAPI + + Args: + + Keyword Args: + name (str): defaults to 'default-name', must be one of ['default-name'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.name = name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py new file mode 100644 index 000000000000..f268d8576d59 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ClassModel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_class': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + '_class': '_class', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """class_model.ClassModel - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _class (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py new file mode 100644 index 000000000000..1097c624d729 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Client(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'client': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'client': 'client', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """client.Client - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + client (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py new file mode 100644 index 000000000000..b29e31d4e5d5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.models.animal'] +try: + from petstore_api.models import dog_all_of +except ImportError: + dog_all_of = sys.modules[ + 'petstore_api.models.dog_all_of'] + + +class Dog(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'class_name': (str,), # noqa: E501 + 'breed': (str,), # noqa: E501 + 'color': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'class_name': 'className', # noqa: E501 + 'breed': 'breed', # noqa: E501 + 'color': 'color', # noqa: E501 + } + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """dog.Dog - a model defined in OpenAPI + + Args: + class_name (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + color (str): [optional] if omitted the server will use the default value of 'red' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_from_server': _from_server, + '_configuration': _configuration, + } + model_args = { + 'class_name': class_name, + } + model_args.update(kwargs) + composed_info = validate_get_composed_info( + constant_args, model_args, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + + self.class_name = class_name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) + + @staticmethod + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + return { + 'anyOf': [ + ], + 'allOf': [ + animal.Animal, + dog_all_of.DogAllOf, + ], + 'oneOf': [ + ], + } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py new file mode 100644 index 000000000000..316ec102b91d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class DogAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'breed': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'breed': 'breed', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """dog_all_of.DogAllOf - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + breed (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py new file mode 100644 index 000000000000..d997d53fac7a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class EnumArrays(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('just_symbol',): { + '>=': ">=", + '$': "$", + }, + ('array_enum',): { + 'FISH': "fish", + 'CRAB': "crab", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_symbol': (str,), # noqa: E501 + 'array_enum': ([str],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'just_symbol': 'just_symbol', # noqa: E501 + 'array_enum': 'array_enum', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """enum_arrays.EnumArrays - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_symbol (str): [optional] # noqa: E501 + array_enum ([str]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py new file mode 100644 index 000000000000..bda8183ce786 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class EnumClass(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """enum_class.EnumClass - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to '-efg', must be one of ['-efg'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py new file mode 100644 index 000000000000..9c6fc29d4580 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import outer_enum +except ImportError: + outer_enum = sys.modules[ + 'petstore_api.models.outer_enum'] +try: + from petstore_api.models import outer_enum_default_value +except ImportError: + outer_enum_default_value = sys.modules[ + 'petstore_api.models.outer_enum_default_value'] +try: + from petstore_api.models import outer_enum_integer +except ImportError: + outer_enum_integer = sys.modules[ + 'petstore_api.models.outer_enum_integer'] +try: + from petstore_api.models import outer_enum_integer_default_value +except ImportError: + outer_enum_integer_default_value = sys.modules[ + 'petstore_api.models.outer_enum_integer_default_value'] + + +class EnumTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_string_required',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + 'EMPTY': "", + }, + ('enum_integer',): { + '1': 1, + '-1': -1, + }, + ('enum_number',): { + '1.1': 1.1, + '-1.2': -1.2, + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'enum_string_required': (str,), # noqa: E501 + 'enum_string': (str,), # noqa: E501 + 'enum_integer': (int,), # noqa: E501 + 'enum_number': (float,), # noqa: E501 + 'outer_enum': (outer_enum.OuterEnum,), # noqa: E501 + 'outer_enum_integer': (outer_enum_integer.OuterEnumInteger,), # noqa: E501 + 'outer_enum_default_value': (outer_enum_default_value.OuterEnumDefaultValue,), # noqa: E501 + 'outer_enum_integer_default_value': (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'enum_string_required': 'enum_string_required', # noqa: E501 + 'enum_string': 'enum_string', # noqa: E501 + 'enum_integer': 'enum_integer', # noqa: E501 + 'enum_number': 'enum_number', # noqa: E501 + 'outer_enum': 'outerEnum', # noqa: E501 + 'outer_enum_integer': 'outerEnumInteger', # noqa: E501 + 'outer_enum_default_value': 'outerEnumDefaultValue', # noqa: E501 + 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, enum_string_required, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """enum_test.EnumTest - a model defined in OpenAPI + + Args: + enum_string_required (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_string (str): [optional] # noqa: E501 + enum_integer (int): [optional] # noqa: E501 + enum_number (float): [optional] # noqa: E501 + outer_enum (outer_enum.OuterEnum): [optional] # noqa: E501 + outer_enum_integer (outer_enum_integer.OuterEnumInteger): [optional] # noqa: E501 + outer_enum_default_value (outer_enum_default_value.OuterEnumDefaultValue): [optional] # noqa: E501 + outer_enum_integer_default_value (outer_enum_integer_default_value.OuterEnumIntegerDefaultValue): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.enum_string_required = enum_string_required + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py new file mode 100644 index 000000000000..ecc56b0cd005 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class File(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'source_uri': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'source_uri': 'sourceURI', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """file.File - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + source_uri (str): Test capitalization. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py new file mode 100644 index 000000000000..f1abb16cbc33 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import file +except ImportError: + file = sys.modules[ + 'petstore_api.models.file'] + + +class FileSchemaTestClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'file': (file.File,), # noqa: E501 + 'files': ([file.File],), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'file': 'file', # noqa: E501 + 'files': 'files', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + file (file.File): [optional] # noqa: E501 + files ([file.File]): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py new file mode 100644 index 000000000000..757cebbc1edf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Foo(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'bar': 'bar', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """foo.Foo - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] if omitted the server will use the default value of 'bar' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py new file mode 100644 index 000000000000..7486b49cfe4c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -0,0 +1,215 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class FormatTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + 'inclusive_maximum': 987.6, + 'inclusive_minimum': 54.3, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('pattern_with_digits',): { + 'regex': { + 'pattern': r'^\d{10}$', # noqa: E501 + }, + }, + ('pattern_with_digits_and_delimiter',): { + 'regex': { + 'pattern': r'^image_\d{1,3}$', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'number': (float,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'uuid': (str,), # noqa: E501 + 'pattern_with_digits': (str,), # noqa: E501 + 'pattern_with_digits_and_delimiter': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'number': 'number', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'date': 'date', # noqa: E501 + 'password': 'password', # noqa: E501 + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'float': 'float', # noqa: E501 + 'double': 'double', # noqa: E501 + 'string': 'string', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'uuid': 'uuid', # noqa: E501 + 'pattern_with_digits': 'pattern_with_digits', # noqa: E501 + 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, number, byte, date, password, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """format_test.FormatTest - a model defined in OpenAPI + + Args: + number (float): + byte (str): + date (date): + password (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): [optional] # noqa: E501 + int32 (int): [optional] # noqa: E501 + int64 (int): [optional] # noqa: E501 + float (float): [optional] # noqa: E501 + double (float): [optional] # noqa: E501 + string (str): [optional] # noqa: E501 + binary (file_type): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + uuid (str): [optional] # noqa: E501 + pattern_with_digits (str): A string that is a 10 digit number. Can have leading zeros.. [optional] # noqa: E501 + pattern_with_digits_and_delimiter (str): A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.number = number + self.byte = byte + self.date = date + self.password = password + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py new file mode 100644 index 000000000000..90c4908aa898 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class HasOnlyReadOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'foo': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'foo': 'foo', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + foo (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py new file mode 100644 index 000000000000..04a46b759db6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class HealthCheckResult(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'nullable_message': (str, none_type,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'nullable_message': 'NullableMessage', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """health_check_result.HealthCheckResult - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + nullable_message (str, none_type): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py new file mode 100644 index 000000000000..5d3ffe93c5a2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object.InlineObject - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (str): Updated name of the pet. [optional] # noqa: E501 + status (str): Updated status of the pet. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py new file mode 100644 index 000000000000..93c0ec594c53 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject1(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'additional_metadata': (str,), # noqa: E501 + 'file': (file_type,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'additional_metadata': 'additionalMetadata', # noqa: E501 + 'file': 'file', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object1.InlineObject1 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + file (file_type): file to upload. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py new file mode 100644 index 000000000000..17ef9471842a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject2(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('enum_form_string_array',): { + '>': ">", + '$': "$", + }, + ('enum_form_string',): { + '_ABC': "_abc", + '-EFG': "-efg", + '(XYZ)': "(xyz)", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'enum_form_string_array': ([str],), # noqa: E501 + 'enum_form_string': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'enum_form_string_array': 'enum_form_string_array', # noqa: E501 + 'enum_form_string': 'enum_form_string', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object2.InlineObject2 - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + enum_form_string_array ([str]): Form parameter enum test (string array). [optional] # noqa: E501 + enum_form_string (str): Form parameter enum test (string). [optional] if omitted the server will use the default value of '-efg' # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py new file mode 100644 index 000000000000..8fd4f33ead37 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject3(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('number',): { + 'inclusive_maximum': 543.2, + 'inclusive_minimum': 32.1, + }, + ('double',): { + 'inclusive_maximum': 123.4, + 'inclusive_minimum': 67.8, + }, + ('pattern_without_delimiter',): { + 'regex': { + 'pattern': r'^[A-Z].*', # noqa: E501 + }, + }, + ('integer',): { + 'inclusive_maximum': 100, + 'inclusive_minimum': 10, + }, + ('int32',): { + 'inclusive_maximum': 200, + 'inclusive_minimum': 20, + }, + ('float',): { + 'inclusive_maximum': 987.6, + }, + ('string',): { + 'regex': { + 'pattern': r'[a-z]', # noqa: E501 + 'flags': (re.IGNORECASE) + }, + }, + ('password',): { + 'max_length': 64, + 'min_length': 10, + }, + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'number': (float,), # noqa: E501 + 'double': (float,), # noqa: E501 + 'pattern_without_delimiter': (str,), # noqa: E501 + 'byte': (str,), # noqa: E501 + 'integer': (int,), # noqa: E501 + 'int32': (int,), # noqa: E501 + 'int64': (int,), # noqa: E501 + 'float': (float,), # noqa: E501 + 'string': (str,), # noqa: E501 + 'binary': (file_type,), # noqa: E501 + 'date': (date,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'callback': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'number': 'number', # noqa: E501 + 'double': 'double', # noqa: E501 + 'pattern_without_delimiter': 'pattern_without_delimiter', # noqa: E501 + 'byte': 'byte', # noqa: E501 + 'integer': 'integer', # noqa: E501 + 'int32': 'int32', # noqa: E501 + 'int64': 'int64', # noqa: E501 + 'float': 'float', # noqa: E501 + 'string': 'string', # noqa: E501 + 'binary': 'binary', # noqa: E501 + 'date': 'date', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'password': 'password', # noqa: E501 + 'callback': 'callback', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, number, double, pattern_without_delimiter, byte, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object3.InlineObject3 - a model defined in OpenAPI + + Args: + number (float): None + double (float): None + pattern_without_delimiter (str): None + byte (str): None + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer (int): None. [optional] # noqa: E501 + int32 (int): None. [optional] # noqa: E501 + int64 (int): None. [optional] # noqa: E501 + float (float): None. [optional] # noqa: E501 + string (str): None. [optional] # noqa: E501 + binary (file_type): None. [optional] # noqa: E501 + date (date): None. [optional] # noqa: E501 + date_time (datetime): None. [optional] # noqa: E501 + password (str): None. [optional] # noqa: E501 + callback (str): None. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.number = number + self.double = double + self.pattern_without_delimiter = pattern_without_delimiter + self.byte = byte + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py new file mode 100644 index 000000000000..ed787c2e253d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject4(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'param': (str,), # noqa: E501 + 'param2': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'param': 'param', # noqa: E501 + 'param2': 'param2', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object4.InlineObject4 - a model defined in OpenAPI + + Args: + param (str): field1 + param2 (str): field2 + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.param = param + self.param2 = param2 + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py new file mode 100644 index 000000000000..44e1572bb3b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class InlineObject5(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'required_file': (file_type,), # noqa: E501 + 'additional_metadata': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'required_file': 'requiredFile', # noqa: E501 + 'additional_metadata': 'additionalMetadata', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, required_file, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_object5.InlineObject5 - a model defined in OpenAPI + + Args: + required_file (file_type): file to upload + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + additional_metadata (str): Additional data to pass to server. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.required_file = required_file + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py new file mode 100644 index 000000000000..0154a9e6c403 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import foo +except ImportError: + foo = sys.modules[ + 'petstore_api.models.foo'] + + +class InlineResponseDefault(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'string': (foo.Foo,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'string': 'string', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """inline_response_default.InlineResponseDefault - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + string (foo.Foo): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py new file mode 100644 index 000000000000..e6816fb51a0d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class List(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_123_list': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + '_123_list': '123-list', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """list.List - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _123_list (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py new file mode 100644 index 000000000000..e996e27991c1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import string_boolean_map +except ImportError: + string_boolean_map = sys.modules[ + 'petstore_api.models.string_boolean_map'] + + +class MapTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('map_of_enum_string',): { + 'UPPER': "UPPER", + 'LOWER': "lower", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 + 'map_of_enum_string': ({str: (str,)},), # noqa: E501 + 'direct_map': ({str: (bool,)},), # noqa: E501 + 'indirect_map': (string_boolean_map.StringBooleanMap,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'map_map_of_string': 'map_map_of_string', # noqa: E501 + 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 + 'direct_map': 'direct_map', # noqa: E501 + 'indirect_map': 'indirect_map', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """map_test.MapTest - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 + map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 + direct_map ({str: (bool,)}): [optional] # noqa: E501 + indirect_map (string_boolean_map.StringBooleanMap): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..60b897624568 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import animal +except ImportError: + animal = sys.modules[ + 'petstore_api.models.animal'] + + +class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'uuid': (str,), # noqa: E501 + 'date_time': (datetime,), # noqa: E501 + 'map': ({str: (animal.Animal,)},), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'uuid': 'uuid', # noqa: E501 + 'date_time': 'dateTime', # noqa: E501 + 'map': 'map', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + uuid (str): [optional] # noqa: E501 + date_time (datetime): [optional] # noqa: E501 + map ({str: (animal.Animal,)}): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py new file mode 100644 index 000000000000..cdfb0db9d60a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Model200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + '_class': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + '_class': 'class', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """model200_response.Model200Response - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + name (int): [optional] # noqa: E501 + _class (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py new file mode 100644 index 000000000000..a145f8e706cc --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ModelReturn(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + '_return': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + '_return': 'return', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """model_return.ModelReturn - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _return (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py new file mode 100644 index 000000000000..e3b0378bab68 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Name(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (int,), # noqa: E501 + 'snake_case': (int,), # noqa: E501 + '_property': (str,), # noqa: E501 + '_123_number': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'snake_case': 'snake_case', # noqa: E501 + '_property': 'property', # noqa: E501 + '_123_number': '123Number', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """name.Name - a model defined in OpenAPI + + Args: + name (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + snake_case (int): [optional] # noqa: E501 + _property (str): [optional] # noqa: E501 + _123_number (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.name = name + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py new file mode 100644 index 000000000000..286f98f1a99c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class NullableClass(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'integer_prop': (int, none_type,), # noqa: E501 + 'number_prop': (float, none_type,), # noqa: E501 + 'boolean_prop': (bool, none_type,), # noqa: E501 + 'string_prop': (str, none_type,), # noqa: E501 + 'date_prop': (date, none_type,), # noqa: E501 + 'datetime_prop': (datetime, none_type,), # noqa: E501 + 'array_nullable_prop': ([bool, date, datetime, dict, float, int, list, str], none_type,), # noqa: E501 + 'array_and_items_nullable_prop': ([bool, date, datetime, dict, float, int, list, str, none_type], none_type,), # noqa: E501 + 'array_items_nullable': ([bool, date, datetime, dict, float, int, list, str, none_type],), # noqa: E501 + 'object_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type,), # noqa: E501 + 'object_and_items_nullable_prop': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'object_items_nullable': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'integer_prop': 'integer_prop', # noqa: E501 + 'number_prop': 'number_prop', # noqa: E501 + 'boolean_prop': 'boolean_prop', # noqa: E501 + 'string_prop': 'string_prop', # noqa: E501 + 'date_prop': 'date_prop', # noqa: E501 + 'datetime_prop': 'datetime_prop', # noqa: E501 + 'array_nullable_prop': 'array_nullable_prop', # noqa: E501 + 'array_and_items_nullable_prop': 'array_and_items_nullable_prop', # noqa: E501 + 'array_items_nullable': 'array_items_nullable', # noqa: E501 + 'object_nullable_prop': 'object_nullable_prop', # noqa: E501 + 'object_and_items_nullable_prop': 'object_and_items_nullable_prop', # noqa: E501 + 'object_items_nullable': 'object_items_nullable', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """nullable_class.NullableClass - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + integer_prop (int, none_type): [optional] # noqa: E501 + number_prop (float, none_type): [optional] # noqa: E501 + boolean_prop (bool, none_type): [optional] # noqa: E501 + string_prop (str, none_type): [optional] # noqa: E501 + date_prop (date, none_type): [optional] # noqa: E501 + datetime_prop (datetime, none_type): [optional] # noqa: E501 + array_nullable_prop ([bool, date, datetime, dict, float, int, list, str], none_type): [optional] # noqa: E501 + array_and_items_nullable_prop ([bool, date, datetime, dict, float, int, list, str, none_type], none_type): [optional] # noqa: E501 + array_items_nullable ([bool, date, datetime, dict, float, int, list, str, none_type]): [optional] # noqa: E501 + object_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str,)}, none_type): [optional] # noqa: E501 + object_and_items_nullable_prop ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + object_items_nullable ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py new file mode 100644 index 000000000000..6a30356c5e92 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class NumberOnly(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'just_number': (float,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'just_number': 'JustNumber', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """number_only.NumberOnly - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + just_number (float): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py new file mode 100644 index 000000000000..6e4e8af79faf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Order(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'pet_id': (int,), # noqa: E501 + 'quantity': (int,), # noqa: E501 + 'ship_date': (datetime,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'complete': (bool,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'id': 'id', # noqa: E501 + 'pet_id': 'petId', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'ship_date': 'shipDate', # noqa: E501 + 'status': 'status', # noqa: E501 + 'complete': 'complete', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """order.Order - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + pet_id (int): [optional] # noqa: E501 + quantity (int): [optional] # noqa: E501 + ship_date (datetime): [optional] # noqa: E501 + status (str): Order Status. [optional] # noqa: E501 + complete (bool): [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py new file mode 100644 index 000000000000..99b7406df90a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterComposite(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'my_number': (float,), # noqa: E501 + 'my_string': (str,), # noqa: E501 + 'my_boolean': (bool,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'my_number': 'my_number', # noqa: E501 + 'my_string': 'my_string', # noqa: E501 + 'my_boolean': 'my_boolean', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_composite.OuterComposite - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + my_number (float): [optional] # noqa: E501 + my_string (str): [optional] # noqa: E501 + my_boolean (bool): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py new file mode 100644 index 000000000000..90f65c56cef5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str, none_type,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum.OuterEnum - a model defined in OpenAPI + + Args: + value (str, none_type): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py new file mode 100644 index 000000000000..35f86a699e64 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnumDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PLACED': "placed", + 'APPROVED': "approved", + 'DELIVERED': "delivered", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value='placed', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum_default_value.OuterEnumDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (str): defaults to 'placed', must be one of ['placed'] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py new file mode 100644 index 000000000000..2a80e1133c8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnumInteger(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum_integer.OuterEnumInteger - a model defined in OpenAPI + + Args: + value (int): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py new file mode 100644 index 000000000000..3de92379cb38 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class OuterEnumIntegerDefaultValue(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '0': 0, + '1': 1, + '2': 2, + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """outer_enum_integer_default_value.OuterEnumIntegerDefaultValue - a model defined in OpenAPI + + Args: + + Keyword Args: + value (int): defaults to 0, must be one of [0] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.value = value + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py new file mode 100644 index 000000000000..11ffa6ff44f5 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) +try: + from petstore_api.models import category +except ImportError: + category = sys.modules[ + 'petstore_api.models.category'] +try: + from petstore_api.models import tag +except ImportError: + tag = sys.modules[ + 'petstore_api.models.tag'] + + +class Pet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'AVAILABLE': "available", + 'PENDING': "pending", + 'SOLD': "sold", + }, + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'photo_urls': ([str],), # noqa: E501 + 'id': (int,), # noqa: E501 + 'category': (category.Category,), # noqa: E501 + 'tags': ([tag.Tag],), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'name': 'name', # noqa: E501 + 'photo_urls': 'photoUrls', # noqa: E501 + 'id': 'id', # noqa: E501 + 'category': 'category', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """pet.Pet - a model defined in OpenAPI + + Args: + name (str): + photo_urls ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + category (category.Category): [optional] # noqa: E501 + tags ([tag.Tag]): [optional] # noqa: E501 + status (str): pet status in the store. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + self.name = name + self.photo_urls = photo_urls + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py new file mode 100644 index 000000000000..d2239f91920d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class ReadOnlyFirst(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'bar': (str,), # noqa: E501 + 'baz': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'bar': 'bar', # noqa: E501 + 'baz': 'baz', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """read_only_first.ReadOnlyFirst - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + bar (str): [optional] # noqa: E501 + baz (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py new file mode 100644 index 000000000000..607ddacbc056 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class SpecialModelName(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'special_property_name': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'special_property_name': '$special[property.name]', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """special_model_name.SpecialModelName - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + special_property_name (int): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py new file mode 100644 index 000000000000..a5425b412aca --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class StringBooleanMap(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = (bool,) # noqa: E501 + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """string_boolean_map.StringBooleanMap - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py new file mode 100644 index 000000000000..ce06e651ee73 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class Tag(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """tag.Tag - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + name (str): [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py new file mode 100644 index 000000000000..62c3bd48a16a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import +import re # noqa: F401 +import sys # noqa: F401 + +import six # noqa: F401 + +from petstore_api.model_utils import ( # noqa: F401 + ModelComposed, + ModelNormal, + ModelSimple, + date, + datetime, + file_type, + int, + none_type, + str, + validate_get_composed_info, +) + + +class User(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + @staticmethod + def openapi_types(): + """ + This must be a class method so a model may have properties that are + of type self, this ensures that we don't create a cyclic import + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (int,), # noqa: E501 + 'username': (str,), # noqa: E501 + 'first_name': (str,), # noqa: E501 + 'last_name': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + 'password': (str,), # noqa: E501 + 'phone': (str,), # noqa: E501 + 'user_status': (int,), # noqa: E501 + } + + @staticmethod + def discriminator(): + return None + + attribute_map = { + 'id': 'id', # noqa: E501 + 'username': 'username', # noqa: E501 + 'first_name': 'firstName', # noqa: E501 + 'last_name': 'lastName', # noqa: E501 + 'email': 'email', # noqa: E501 + 'password': 'password', # noqa: E501 + 'phone': 'phone', # noqa: E501 + 'user_status': 'userStatus', # noqa: E501 + } + + @staticmethod + def _composed_schemas(): + return None + + required_properties = set([ + '_data_store', + '_check_type', + '_from_server', + '_path_to_item', + '_configuration', + ]) + + def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + """user.User - a model defined in OpenAPI + + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _from_server (bool): True if the data is from the server + False if the data is from the client (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + id (int): [optional] # noqa: E501 + username (str): [optional] # noqa: E501 + first_name (str): [optional] # noqa: E501 + last_name (str): [optional] # noqa: E501 + email (str): [optional] # noqa: E501 + password (str): [optional] # noqa: E501 + phone (str): [optional] # noqa: E501 + user_status (int): User Status. [optional] # noqa: E501 + """ + + self._data_store = {} + self._check_type = _check_type + self._from_server = _from_server + self._path_to_item = _path_to_item + self._configuration = _configuration + + for var_name, var_value in six.iteritems(kwargs): + setattr(self, var_name, var_value) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py new file mode 100644 index 000000000000..7ed815b8a187 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode +import urllib3 + +from petstore_api.exceptions import ApiException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) diff --git a/samples/openapi3/client/petstore/python-experimental/pom.xml b/samples/openapi3/client/petstore/python-experimental/pom.xml new file mode 100644 index 000000000000..2016c019a958 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PythonExperimentalOAS3PetstoreTests + pom + 1.0-SNAPSHOT + Python-Experimental OpenAPI3 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + test + integration-test + + exec + + + make + + test-all + + + + + + + + diff --git a/samples/openapi3/client/petstore/python-experimental/requirements.txt b/samples/openapi3/client/petstore/python-experimental/requirements.txt new file mode 100644 index 000000000000..eb358efd5bd3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/requirements.txt @@ -0,0 +1,6 @@ +certifi >= 14.05.14 +future; python_version<="2.7" +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.cfg b/samples/openapi3/client/petstore/python-experimental/setup.cfg new file mode 100644 index 000000000000..11433ee875ab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py new file mode 100644 index 000000000000..f99ea80ad637 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "petstore-api" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +EXTRAS = {':python_version <= "2.7"': ['future']} + +setup( + name=NAME, + version=VERSION, + description="OpenAPI Petstore", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"], + install_requires=REQUIRES, + extras_require=EXTRAS, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + license="Apache-2.0", + long_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: \" \\ # noqa: E501 + """ +) diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt new file mode 100644 index 000000000000..06f7754d2044 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -0,0 +1,4 @@ +pytest~=4.6.7 # needed for python 2.7+3.4 +pytest-cov>=2.8.1 +pytest-randomly==1.2.3 # needed for python 2.7+3.4 +mock; python_version<="2.7" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/test/__init__.py b/samples/openapi3/client/petstore/python-experimental/test/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py new file mode 100644 index 000000000000..279baa3a454f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestAdditionalPropertiesClass(unittest.TestCase): + """AdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAdditionalPropertiesClass(self): + """Test AdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.AdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_animal.py b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py new file mode 100644 index 000000000000..66f94c5eef4e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_animal.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestAnimal(unittest.TestCase): + """Animal unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAnimal(self): + """Test Animal""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Animal() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py new file mode 100644 index 000000000000..d95798cfc5a4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_another_fake_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.another_fake_api import AnotherFakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestAnotherFakeApi(unittest.TestCase): + """AnotherFakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.another_fake_api.AnotherFakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_call_123_test_special_tags(self): + """Test case for call_123_test_special_tags + + To test special tags # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py new file mode 100644 index 000000000000..a253e6f364cd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_api_response.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestApiResponse(unittest.TestCase): + """ApiResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApiResponse(self): + """Test ApiResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ApiResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py new file mode 100644 index 000000000000..e47430f6861a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestArrayOfArrayOfNumberOnly(unittest.TestCase): + """ArrayOfArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfArrayOfNumberOnly(self): + """Test ArrayOfArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ArrayOfArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py new file mode 100644 index 000000000000..1a65f69b9268 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestArrayOfNumberOnly(unittest.TestCase): + """ArrayOfNumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayOfNumberOnly(self): + """Test ArrayOfNumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ArrayOfNumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py new file mode 100644 index 000000000000..ac1b486bb74e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_array_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestArrayTest(unittest.TestCase): + """ArrayTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArrayTest(self): + """Test ArrayTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ArrayTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py new file mode 100644 index 000000000000..1cb91380a768 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_capitalization.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCapitalization(unittest.TestCase): + """Capitalization unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapitalization(self): + """Test Capitalization""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Capitalization() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py new file mode 100644 index 000000000000..bd616261861d --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCat(unittest.TestCase): + """Cat unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCat(self): + """Test Cat""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Cat() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py new file mode 100644 index 000000000000..136ed8da050a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_cat_all_of.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCatAllOf(unittest.TestCase): + """CatAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCatAllOf(self): + """Test CatAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.CatAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_category.py b/samples/openapi3/client/petstore/python-experimental/test/test_category.py new file mode 100644 index 000000000000..c2ab96f823b6 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_category.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestCategory(unittest.TestCase): + """Category unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCategory(self): + """Test Category""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Category() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py new file mode 100644 index 000000000000..3ac7e553042e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_class_model.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestClassModel(unittest.TestCase): + """ClassModel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClassModel(self): + """Test ClassModel""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ClassModel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_client.py b/samples/openapi3/client/petstore/python-experimental/test/test_client.py new file mode 100644 index 000000000000..683190363445 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_client.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestClient(unittest.TestCase): + """Client unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testClient(self): + """Test Client""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Client() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py new file mode 100644 index 000000000000..50e7c57bd0bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_default_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.default_api import DefaultApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.default_api.DefaultApi() # noqa: E501 + + def tearDown(self): + pass + + def test_foo_get(self): + """Test case for foo_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py new file mode 100644 index 000000000000..37e9dd56d4ff --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestDog(unittest.TestCase): + """Dog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDog(self): + """Test Dog""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Dog() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py new file mode 100644 index 000000000000..7f443eb9b60c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_dog_all_of.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestDogAllOf(unittest.TestCase): + """DogAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDogAllOf(self): + """Test DogAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.DogAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py new file mode 100644 index 000000000000..5f789287332a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_arrays.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestEnumArrays(unittest.TestCase): + """EnumArrays unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumArrays(self): + """Test EnumArrays""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.EnumArrays() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py new file mode 100644 index 000000000000..f25e772ff26a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestEnumClass(unittest.TestCase): + """EnumClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumClass(self): + """Test EnumClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.EnumClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py new file mode 100644 index 000000000000..8238fb7a3ab9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_enum_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestEnumTest(unittest.TestCase): + """EnumTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEnumTest(self): + """Test EnumTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.EnumTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py new file mode 100644 index 000000000000..581d1499eedf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_api import FakeApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeApi(unittest.TestCase): + """FakeApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_api.FakeApi() # noqa: E501 + + def tearDown(self): + pass + + def test_fake_health_get(self): + """Test case for fake_health_get + + Health check endpoint # noqa: E501 + """ + pass + + def test_fake_outer_boolean_serialize(self): + """Test case for fake_outer_boolean_serialize + + """ + pass + + def test_fake_outer_composite_serialize(self): + """Test case for fake_outer_composite_serialize + + """ + pass + + def test_fake_outer_number_serialize(self): + """Test case for fake_outer_number_serialize + + """ + pass + + def test_fake_outer_string_serialize(self): + """Test case for fake_outer_string_serialize + + """ + pass + + def test_test_body_with_file_schema(self): + """Test case for test_body_with_file_schema + + """ + pass + + def test_test_body_with_query_params(self): + """Test case for test_body_with_query_params + + """ + pass + + def test_test_client_model(self): + """Test case for test_client_model + + To test \"client\" model # noqa: E501 + """ + pass + + def test_test_endpoint_parameters(self): + """Test case for test_endpoint_parameters + + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 # noqa: E501 + """ + pass + + def test_test_enum_parameters(self): + """Test case for test_enum_parameters + + To test enum parameters # noqa: E501 + """ + pass + + def test_test_group_parameters(self): + """Test case for test_group_parameters + + Fake endpoint to test group parameters (optional) # noqa: E501 + """ + pass + + def test_test_inline_additional_properties(self): + """Test case for test_inline_additional_properties + + test inline additionalProperties # noqa: E501 + """ + pass + + def test_test_json_form_data(self): + """Test case for test_json_form_data + + test json serialization of form data # noqa: E501 + """ + pass + + def test_test_query_parameter_collection_format(self): + """Test case for test_query_parameter_collection_format + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py new file mode 100644 index 000000000000..f54e0d06644f --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.fake_classname_tags_123_api import FakeClassnameTags123Api # noqa: E501 +from petstore_api.rest import ApiException + + +class TestFakeClassnameTags123Api(unittest.TestCase): + """FakeClassnameTags123Api unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.fake_classname_tags_123_api.FakeClassnameTags123Api() # noqa: E501 + + def tearDown(self): + pass + + def test_test_classname(self): + """Test case for test_classname + + To test class name in snake case # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file.py b/samples/openapi3/client/petstore/python-experimental/test/test_file.py new file mode 100644 index 000000000000..af185e32e6e8 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFile(unittest.TestCase): + """File unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFile(self): + """Test File""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.File() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py new file mode 100644 index 000000000000..c2de4e866cda --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFileSchemaTestClass(unittest.TestCase): + """FileSchemaTestClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFileSchemaTestClass(self): + """Test FileSchemaTestClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.FileSchemaTestClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_foo.py b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py new file mode 100644 index 000000000000..c54feb98c25a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_foo.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFoo(unittest.TestCase): + """Foo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFoo(self): + """Test Foo""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Foo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py new file mode 100644 index 000000000000..a9d39521e934 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_format_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestFormatTest(unittest.TestCase): + """FormatTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFormatTest(self): + """Test FormatTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.FormatTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py new file mode 100644 index 000000000000..e042faf7c94c --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestHasOnlyReadOnly(unittest.TestCase): + """HasOnlyReadOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHasOnlyReadOnly(self): + """Test HasOnlyReadOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.HasOnlyReadOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py new file mode 100644 index 000000000000..ebcc32f43964 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_health_check_result.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestHealthCheckResult(unittest.TestCase): + """HealthCheckResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testHealthCheckResult(self): + """Test HealthCheckResult""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.HealthCheckResult() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py new file mode 100644 index 000000000000..fc2e177006a2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject(unittest.TestCase): + """InlineObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject(self): + """Test InlineObject""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py new file mode 100644 index 000000000000..12a62225defd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object1.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject1(unittest.TestCase): + """InlineObject1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject1(self): + """Test InlineObject1""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject1() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py new file mode 100644 index 000000000000..1651197f964b --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object2.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject2(unittest.TestCase): + """InlineObject2 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject2(self): + """Test InlineObject2""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject2() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py new file mode 100644 index 000000000000..2efbae377dde --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object3.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject3(unittest.TestCase): + """InlineObject3 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject3(self): + """Test InlineObject3""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject3() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py new file mode 100644 index 000000000000..4f74d9cacacf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object4.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject4(unittest.TestCase): + """InlineObject4 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject4(self): + """Test InlineObject4""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject4() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py new file mode 100644 index 000000000000..895cc44ea290 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_object5.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineObject5(unittest.TestCase): + """InlineObject5 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineObject5(self): + """Test InlineObject5""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineObject5() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py new file mode 100644 index 000000000000..ecdd05f72fa4 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_inline_response_default.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestInlineResponseDefault(unittest.TestCase): + """InlineResponseDefault unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponseDefault(self): + """Test InlineResponseDefault""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.InlineResponseDefault() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_list.py b/samples/openapi3/client/petstore/python-experimental/test/test_list.py new file mode 100644 index 000000000000..29979911a8e9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_list.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestList(unittest.TestCase): + """List unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testList(self): + """Test List""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.List() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py new file mode 100644 index 000000000000..8592f21949bd --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_map_test.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestMapTest(unittest.TestCase): + """MapTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMapTest(self): + """Test MapTest""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.MapTest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py new file mode 100644 index 000000000000..a4e89d3e8c07 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase): + """MixedPropertiesAndAdditionalPropertiesClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMixedPropertiesAndAdditionalPropertiesClass(self): + """Test MixedPropertiesAndAdditionalPropertiesClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.MixedPropertiesAndAdditionalPropertiesClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py new file mode 100644 index 000000000000..149629fe1e8e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model200_response.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestModel200Response(unittest.TestCase): + """Model200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModel200Response(self): + """Test Model200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Model200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py new file mode 100644 index 000000000000..e48b2c479839 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_model_return.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestModelReturn(unittest.TestCase): + """ModelReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelReturn(self): + """Test ModelReturn""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ModelReturn() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_name.py new file mode 100644 index 000000000000..1f6407683b29 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_name.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestName(unittest.TestCase): + """Name unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testName(self): + """Test Name""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Name() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py new file mode 100644 index 000000000000..8af2cb8447ee --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_nullable_class.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestNullableClass(unittest.TestCase): + """NullableClass unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNullableClass(self): + """Test NullableClass""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.NullableClass() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py new file mode 100644 index 000000000000..732baf4b84ed --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_number_only.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestNumberOnly(unittest.TestCase): + """NumberOnly unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumberOnly(self): + """Test NumberOnly""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.NumberOnly() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_order.py b/samples/openapi3/client/petstore/python-experimental/test/test_order.py new file mode 100644 index 000000000000..10ce38e954ea --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_order.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOrder(unittest.TestCase): + """Order unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrder(self): + """Test Order""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Order() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py new file mode 100644 index 000000000000..c191d04ec6b2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_composite.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterComposite(unittest.TestCase): + """OuterComposite unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterComposite(self): + """Test OuterComposite""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterComposite() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py new file mode 100644 index 000000000000..ad8f7cc68b28 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnum(unittest.TestCase): + """OuterEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnum(self): + """Test OuterEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py new file mode 100644 index 000000000000..80c9534a88e2 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_default_value.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnumDefaultValue(unittest.TestCase): + """OuterEnumDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumDefaultValue(self): + """Test OuterEnumDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnumDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py new file mode 100644 index 000000000000..60724eefd711 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnumInteger(unittest.TestCase): + """OuterEnumInteger unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumInteger(self): + """Test OuterEnumInteger""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnumInteger() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py new file mode 100644 index 000000000000..8eca8fa69ac1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_outer_enum_integer_default_value.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestOuterEnumIntegerDefaultValue(unittest.TestCase): + """OuterEnumIntegerDefaultValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOuterEnumIntegerDefaultValue(self): + """Test OuterEnumIntegerDefaultValue""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.OuterEnumIntegerDefaultValue() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py new file mode 100644 index 000000000000..db9e3729f505 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestPet(unittest.TestCase): + """Pet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPet(self): + """Test Pet""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Pet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py new file mode 100644 index 000000000000..77665df879f1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_pet_api.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.pet_api import PetApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestPetApi(unittest.TestCase): + """PetApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.pet_api.PetApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_pet(self): + """Test case for add_pet + + Add a new pet to the store # noqa: E501 + """ + pass + + def test_delete_pet(self): + """Test case for delete_pet + + Deletes a pet # noqa: E501 + """ + pass + + def test_find_pets_by_status(self): + """Test case for find_pets_by_status + + Finds Pets by status # noqa: E501 + """ + pass + + def test_find_pets_by_tags(self): + """Test case for find_pets_by_tags + + Finds Pets by tags # noqa: E501 + """ + pass + + def test_get_pet_by_id(self): + """Test case for get_pet_by_id + + Find pet by ID # noqa: E501 + """ + pass + + def test_update_pet(self): + """Test case for update_pet + + Update an existing pet # noqa: E501 + """ + pass + + def test_update_pet_with_form(self): + """Test case for update_pet_with_form + + Updates a pet in the store with form data # noqa: E501 + """ + pass + + def test_upload_file(self): + """Test case for upload_file + + uploads an image # noqa: E501 + """ + pass + + def test_upload_file_with_required_file(self): + """Test case for upload_file_with_required_file + + uploads an image (required) # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py new file mode 100644 index 000000000000..553768f3303a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_read_only_first.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestReadOnlyFirst(unittest.TestCase): + """ReadOnlyFirst unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReadOnlyFirst(self): + """Test ReadOnlyFirst""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.ReadOnlyFirst() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py new file mode 100644 index 000000000000..7de520d9cefe --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_special_model_name.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestSpecialModelName(unittest.TestCase): + """SpecialModelName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSpecialModelName(self): + """Test SpecialModelName""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.SpecialModelName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py new file mode 100644 index 000000000000..81848d24a67e --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_store_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.store_api import StoreApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.store_api.StoreApi() # noqa: E501 + + def tearDown(self): + pass + + def test_delete_order(self): + """Test case for delete_order + + Delete purchase order by ID # noqa: E501 + """ + pass + + def test_get_inventory(self): + """Test case for get_inventory + + Returns pet inventories by status # noqa: E501 + """ + pass + + def test_get_order_by_id(self): + """Test case for get_order_by_id + + Find purchase order by ID # noqa: E501 + """ + pass + + def test_place_order(self): + """Test case for place_order + + Place an order for a pet # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py new file mode 100644 index 000000000000..af071721eba3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestStringBooleanMap(unittest.TestCase): + """StringBooleanMap unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testStringBooleanMap(self): + """Test StringBooleanMap""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.StringBooleanMap() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_tag.py b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py new file mode 100644 index 000000000000..27c2be5391ab --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_tag.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user.py b/samples/openapi3/client/petstore/python-experimental/test/test_user.py new file mode 100644 index 000000000000..3df641e29b6a --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api + + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUser(self): + """Test User""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.User() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py new file mode 100644 index 000000000000..6df730fba2b1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test/test_user_api.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.api.user_api import UserApi # noqa: E501 +from petstore_api.rest import ApiException + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self): + self.api = petstore_api.api.user_api.UserApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_user(self): + """Test case for create_user + + Create user # noqa: E501 + """ + pass + + def test_create_users_with_array_input(self): + """Test case for create_users_with_array_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_create_users_with_list_input(self): + """Test case for create_users_with_list_input + + Creates list of users with given input array # noqa: E501 + """ + pass + + def test_delete_user(self): + """Test case for delete_user + + Delete user # noqa: E501 + """ + pass + + def test_get_user_by_name(self): + """Test case for get_user_by_name + + Get user by user name # noqa: E501 + """ + pass + + def test_login_user(self): + """Test case for login_user + + Logs user into the system # noqa: E501 + """ + pass + + def test_logout_user(self): + """Test case for logout_user + + Logs out current logged in user session # noqa: E501 + """ + pass + + def test_update_user(self): + """Test case for update_user + + Updated user # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2.sh b/samples/openapi3/client/petstore/python-experimental/test_python2.sh new file mode 100755 index 000000000000..b2f344ec8977 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test_python2.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 +PYTHONPATH="$(which python)" + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --python=$PYTHONPATH --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT + +### run tests +tox -e py27 || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi + diff --git a/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh b/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh new file mode 100755 index 000000000000..3205dfd07da9 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/test_python2_and_3.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT + +### run tests +tox || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/samples/openapi3/client/petstore/python-experimental/tox.ini b/samples/openapi3/client/petstore/python-experimental/tox.ini new file mode 100644 index 000000000000..169d895329bf --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py27, py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=petstore_api diff --git a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml b/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml index aa04dfb3cb13..922e0b4af696 100644 --- a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml +++ b/samples/openapi3/server/petstore/python-flask-python2/openapi_server/openapi/openapi.yaml @@ -26,7 +26,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -41,11 +41,11 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found - 405: + "405": description: Validation exception security: - petstore_auth: @@ -76,7 +76,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -89,7 +89,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid status value security: - petstore_auth: @@ -116,7 +116,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -129,7 +129,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid tag value security: - petstore_auth: @@ -159,7 +159,7 @@ paths: type: integer style: simple responses: - 400: + "400": description: Invalid pet value security: - petstore_auth: @@ -183,7 +183,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -192,9 +192,9 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found security: - api_key: [] @@ -228,7 +228,7 @@ paths: type: string type: object responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -266,7 +266,7 @@ paths: type: string type: object responses: - 200: + "200": content: application/json: schema: @@ -285,7 +285,7 @@ paths: description: Returns a map of status codes to quantities operationId: get_inventory responses: - 200: + "200": content: application/json: schema: @@ -311,7 +311,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -320,7 +320,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid Order summary: Place an order for a pet tags: @@ -341,9 +341,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Delete purchase order by ID tags: @@ -366,7 +366,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -375,9 +375,9 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Find purchase order by ID tags: @@ -453,7 +453,7 @@ paths: type: string style: form responses: - 200: + "200": content: application/xml: schema: @@ -485,7 +485,7 @@ paths: format: date-time type: string style: simple - 400: + "400": description: Invalid username/password supplied summary: Logs user into the system tags: @@ -517,9 +517,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found security: - auth_cookie: [] @@ -539,7 +539,7 @@ paths: type: string style: simple responses: - 200: + "200": content: application/xml: schema: @@ -548,9 +548,9 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found summary: Get user by user name tags: @@ -576,9 +576,9 @@ paths: description: Updated user object required: true responses: - 400: + "400": description: Invalid user supplied - 404: + "404": description: User not found security: - auth_cookie: [] diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml b/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml index aa04dfb3cb13..922e0b4af696 100644 --- a/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml +++ b/samples/openapi3/server/petstore/python-flask/openapi_server/openapi/openapi.yaml @@ -26,7 +26,7 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -41,11 +41,11 @@ paths: requestBody: $ref: '#/components/requestBodies/Pet' responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found - 405: + "405": description: Validation exception security: - petstore_auth: @@ -76,7 +76,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -89,7 +89,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid status value security: - petstore_auth: @@ -116,7 +116,7 @@ paths: type: array style: form responses: - 200: + "200": content: application/xml: schema: @@ -129,7 +129,7 @@ paths: $ref: '#/components/schemas/Pet' type: array description: successful operation - 400: + "400": description: Invalid tag value security: - petstore_auth: @@ -159,7 +159,7 @@ paths: type: integer style: simple responses: - 400: + "400": description: Invalid pet value security: - petstore_auth: @@ -183,7 +183,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -192,9 +192,9 @@ paths: schema: $ref: '#/components/schemas/Pet' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Pet not found security: - api_key: [] @@ -228,7 +228,7 @@ paths: type: string type: object responses: - 405: + "405": description: Invalid input security: - petstore_auth: @@ -266,7 +266,7 @@ paths: type: string type: object responses: - 200: + "200": content: application/json: schema: @@ -285,7 +285,7 @@ paths: description: Returns a map of status codes to quantities operationId: get_inventory responses: - 200: + "200": content: application/json: schema: @@ -311,7 +311,7 @@ paths: description: order placed for purchasing the pet required: true responses: - 200: + "200": content: application/xml: schema: @@ -320,7 +320,7 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid Order summary: Place an order for a pet tags: @@ -341,9 +341,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Delete purchase order by ID tags: @@ -366,7 +366,7 @@ paths: type: integer style: simple responses: - 200: + "200": content: application/xml: schema: @@ -375,9 +375,9 @@ paths: schema: $ref: '#/components/schemas/Order' description: successful operation - 400: + "400": description: Invalid ID supplied - 404: + "404": description: Order not found summary: Find purchase order by ID tags: @@ -453,7 +453,7 @@ paths: type: string style: form responses: - 200: + "200": content: application/xml: schema: @@ -485,7 +485,7 @@ paths: format: date-time type: string style: simple - 400: + "400": description: Invalid username/password supplied summary: Logs user into the system tags: @@ -517,9 +517,9 @@ paths: type: string style: simple responses: - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found security: - auth_cookie: [] @@ -539,7 +539,7 @@ paths: type: string style: simple responses: - 200: + "200": content: application/xml: schema: @@ -548,9 +548,9 @@ paths: schema: $ref: '#/components/schemas/User' description: successful operation - 400: + "400": description: Invalid username supplied - 404: + "404": description: User not found summary: Get user by user name tags: @@ -576,9 +576,9 @@ paths: description: Updated user object required: true responses: - 400: + "400": description: Invalid user supplied - 404: + "404": description: User not found security: - auth_cookie: [] diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs index 5aa1a66468dc..ef3413980eac 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/ApiResponse.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class ApiResponse : IEquatable - { + { /// /// Gets or Sets Code /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs index 792299960943..6ac6a181baf6 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Category.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Category : IEquatable - { + { /// /// Gets or Sets Id /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs index a1715221ba26..77a4c75a1b17 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Order.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Order : IEquatable - { + { /// /// Gets or Sets Id /// @@ -50,6 +50,7 @@ public partial class Order : IEquatable [DataMember(Name="shipDate", EmitDefaultValue=false)] public DateTime ShipDate { get; set; } + /// /// Order Status /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs index cb8a2001f17f..a814c6e1edfe 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Pet.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Pet : IEquatable - { + { /// /// Gets or Sets Id /// @@ -58,6 +58,7 @@ public partial class Pet : IEquatable [DataMember(Name="tags", EmitDefaultValue=false)] public List Tags { get; set; } + /// /// pet status in the store /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs index 223b3ac3af5e..f0a131f617ca 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/Tag.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class Tag : IEquatable - { + { /// /// Gets or Sets Id /// diff --git a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs index dc5595815cdd..3c8a18d63cf7 100644 --- a/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs +++ b/samples/server/petstore/aspnetcore/src/Org.OpenAPITools/Models/User.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Models /// [DataContract] public partial class User : IEquatable - { + { /// /// Gets or Sets Id /// diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index e4955748d3e7..58592f031f65 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.cpp b/samples/server/petstore/cpp-pistache/api/PetApi.cpp index 32d47377c657..e7a00ca65150 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/PetApi.cpp @@ -91,9 +91,9 @@ void PetApi::find_pets_by_status_handler(const Pistache::Rest::Request &request, auto statusQuery = request.query().get("status"); Pistache::Optional> status; if(!statusQuery.isEmpty()){ - std::vector value; - if(fromStringValue(statusQuery.get(), value)){ - status = Pistache::Some(value); + std::vector valueQuery_instance; + if(fromStringValue(statusQuery.get(), valueQuery_instance)){ + status = Pistache::Some(valueQuery_instance); } } @@ -116,9 +116,9 @@ void PetApi::find_pets_by_tags_handler(const Pistache::Rest::Request &request, P auto tagsQuery = request.query().get("tags"); Pistache::Optional> tags; if(!tagsQuery.isEmpty()){ - std::vector value; - if(fromStringValue(tagsQuery.get(), value)){ - tags = Pistache::Some(value); + std::vector valueQuery_instance; + if(fromStringValue(tagsQuery.get(), valueQuery_instance)){ + tags = Pistache::Some(valueQuery_instance); } } diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.cpp b/samples/server/petstore/cpp-pistache/api/UserApi.cpp index 51889d55043b..d0cf89242447 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/UserApi.cpp @@ -143,17 +143,17 @@ void UserApi::login_user_handler(const Pistache::Rest::Request &request, Pistach auto usernameQuery = request.query().get("username"); Pistache::Optional username; if(!usernameQuery.isEmpty()){ - std::string value; - if(fromStringValue(usernameQuery.get(), value)){ - username = Pistache::Some(value); + std::string valueQuery_instance; + if(fromStringValue(usernameQuery.get(), valueQuery_instance)){ + username = Pistache::Some(valueQuery_instance); } } auto passwordQuery = request.query().get("password"); Pistache::Optional password; if(!passwordQuery.isEmpty()){ - std::string value; - if(fromStringValue(passwordQuery.get(), value)){ - password = Pistache::Some(value); + std::string valueQuery_instance; + if(fromStringValue(passwordQuery.get(), valueQuery_instance)){ + password = Pistache::Some(valueQuery_instance); } } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle index bc16c9424f1b..6498d44c2e8e 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle @@ -4,7 +4,7 @@ project.version = "1.0.0" project.group = "org.openapitools" repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle index 1a4dcb70cee3..8e189f8148ce 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle @@ -4,7 +4,7 @@ project.version = "1.0.0" project.group = "org.openapitools" repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { diff --git a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle index 1a4dcb70cee3..8e189f8148ce 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle @@ -4,7 +4,7 @@ project.version = "1.0.0" project.group = "org.openapitools" repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } } dependencies { diff --git a/samples/server/petstore/kotlin-server/ktor/build.gradle b/samples/server/petstore/kotlin-server/ktor/build.gradle index f595575e6f91..25536d4e5316 100644 --- a/samples/server/petstore/kotlin-server/ktor/build.gradle +++ b/samples/server/petstore/kotlin-server/ktor/build.gradle @@ -12,9 +12,9 @@ buildscript { ext.shadow_version = '2.0.3' repositories { - maven { url = "https://repo1.maven.org/maven2" } + maven { url "https://repo1.maven.org/maven2" } maven { - url "https://plugins.gradle.org/m2/" + url = "https://plugins.gradle.org/m2/" } } dependencies { @@ -50,8 +50,8 @@ shadowJar { } repositories { - maven { url = "https://repo1.maven.org/maven2" } - maven { url "https://dl.bintray.com/kotlin/ktor" } + maven { url "https://repo1.maven.org/maven2" } + maven { url "https://dl.bintray.com/kotlin/ktor" } maven { url "https://dl.bintray.com/kotlin/kotlinx" } } diff --git a/website/pages/en/index.js b/website/pages/en/index.js index 9111b5efcd22..698cec53814e 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -179,17 +179,18 @@ class Index extends React.Component { const tryNpmContents = stripMargin` | The [NPM package wrapper](https://github.com/openapitools/openapi-generator-cli) is cross-platform wrapper around the .jar artifact. | **Install** globally, exposing the CLI on the command line: - | + | | \`\`\`bash | # install the latest version of "openapi-generator-cli" | npm install @openapitools/openapi-generator-cli -g | | # install a specific version of "openapi-generator-cli" - | npm install @openapitools/openapi-generator-cli@cli-3.0.0 -g + | npm install @openapitools/openapi-generator-cli@cli-4.2.2 -g | | # Or install it as dev-dependency in your node.js projects | npm install @openapitools/openapi-generator-cli -D | \`\`\` + | | | Then, **generate** a ruby client from a valid [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml) doc: | \`\`\`bash From 2d6516ee92457b26162778a23030f7d5c22aa6ac Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 22 Jan 2020 10:14:01 -0800 Subject: [PATCH 094/102] fix usage of escape character in python regex. Fix generated python documentation --- .../README_common.mustache | 7 +- .../test-requirements.mustache | 5 +- .../python/python_doc_auth_partial.mustache | 26 ++++- .../petstore/python-experimental/README.md | 5 + .../python-experimental/docs/PetApi.md | 96 ++++++++++++++++++- .../petstore_api/api/pet_api.py | 4 + .../petstore_api/api_client.py | 25 ++++- .../petstore_api/configuration.py | 55 ++++++++++- .../petstore/python-experimental/setup.py | 2 + .../python-experimental/test-requirements.txt | 3 +- .../tests/test_http_signature.py | 30 +++--- 11 files changed, 227 insertions(+), 31 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index a8b66b0bed5f..5fffdc74fc69 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -50,12 +50,15 @@ Class | Method | HTTP request | Description - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} - **Type**: HTTP basic authentication -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} - **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} {{/isBasicBearer}} +{{#isHttpSignature}} +- **Type**: HTTP signature authentication +{{/isHttpSignature}} {{/isBasic}} {{#isOAuth}} - **Type**: OAuth diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache index 338b229bae51..1c3a9569e941 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache @@ -10,4 +10,7 @@ pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 {{/useNose}} -mock; python_version<="2.7" \ No newline at end of file +{{#hasHttpSignatureMethods}} +pycryptodome>=3.9.0 +{{/hasHttpSignatureMethods}} +mock; python_version<="2.7" diff --git a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache index 899e4b58b925..9f5b49f82147 100644 --- a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache +++ b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache @@ -2,15 +2,37 @@ {{#authMethods}} configuration = {{{packageName}}}.Configuration() {{#isBasic}} -{{^isBasicBearer}} +{{#isBasicBasic}} # Configure HTTP basic authorization: {{{name}}} configuration.username = 'YOUR_USERNAME' configuration.password = 'YOUR_PASSWORD' -{{/isBasicBearer}} +{{/isBasicBasic}} {{#isBasicBearer}} # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} configuration.access_token = 'YOUR_BEARER_TOKEN' {{/isBasicBearer}} +{{#isHttpSignature}} +# Configure HTTP signature authorization: {{{name}}} +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +{{/isHttpSignature}} {{/isBasic}} {{#isApiKey}} # Configure API key authorization: {{{name}}} diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index 8e82b0a81f3f..1f91ec0bcf0d 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -193,6 +193,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## http_signature_test + +- **Type**: HTTP signature authentication + + ## petstore_auth - **Type**: OAuth diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 90b5647d5f3a..19099269da72 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -22,6 +22,7 @@ Add a new pet to the store ### Example +* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function @@ -29,6 +30,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -58,7 +80,7 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -148,6 +170,7 @@ Multiple status values can be provided with comma separated strings ### Example +* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function @@ -155,6 +178,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -185,7 +229,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -209,6 +253,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example +* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function @@ -216,6 +261,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -246,7 +312,7 @@ Name | Type | Description | Notes ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -332,6 +398,7 @@ Update an existing pet ### Example +* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function @@ -339,6 +406,27 @@ import time import petstore_api from pprint import pprint configuration = petstore_api.Configuration() +# Configure HTTP signature authorization: http_signature_test +# You can specify the signing key-id, private key path, signing scheme, signing algorithm, +# list of signed headers and signature max validity. +configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) +) +configuration = petstore_api.Configuration() # Configure OAuth2 access token for authorization: petstore_auth configuration.access_token = 'YOUR_ACCESS_TOKEN' @@ -368,7 +456,7 @@ void (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[http_signature_test](../README.md#http_signature_test), [petstore_auth](../README.md#petstore_auth) ### HTTP request headers diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 9d890ef25f2a..ceec6252c76f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -110,6 +110,7 @@ def __add_pet(self, pet_pet, **kwargs): # noqa: E501 settings={ 'response_type': None, 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet', @@ -336,6 +337,7 @@ def __find_pets_by_status(self, status, **kwargs): # noqa: E501 settings={ 'response_type': ([pet.Pet],), 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet/findByStatus', @@ -455,6 +457,7 @@ def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 settings={ 'response_type': ([pet.Pet],), 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet/findByTags', @@ -677,6 +680,7 @@ def __update_pet(self, pet_pet, **kwargs): # noqa: E501 settings={ 'response_type': None, 'auth': [ + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index d3e808ddf40b..cfe7438cb66c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -20,6 +20,7 @@ from six.moves.urllib.parse import quote from petstore_api import rest +from petstore_api import signing from petstore_api.configuration import Configuration from petstore_api.exceptions import ApiValueError from petstore_api.model_utils import ( @@ -152,13 +153,14 @@ def __call_api( collection_formats) post_params.extend(self.files_parameters(files)) - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - # body if body: body = self.sanitize_for_serialization(body) + # auth setting + self.update_params_for_auth(header_params, query_params, + auth_settings, resource_path, method, body) + # request url if _host is None: url = self.configuration.host + resource_path @@ -510,12 +512,17 @@ def select_header_content_type(self, content_types): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings): + def update_params_for_auth(self, headers, querys, auth_settings, + resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param querys: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). """ if not auth_settings: return @@ -526,7 +533,15 @@ def update_params_for_auth(self, headers, querys, auth_settings): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, querys) + headers.update(auth_headers) elif auth_setting['in'] == 'query': querys.append((auth_setting['key'], auth_setting['value'])) else: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index 60cb525776a5..99d8bac4b3d3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -37,6 +37,8 @@ class Configuration(object): The dict value is an API key prefix when generating the auth data. :param username: Username for HTTP basic authentication :param password: Password for HTTP basic authentication + :param signing_info: Configuration parameters for HTTP signature. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -55,11 +57,50 @@ class Configuration(object): ) The following cookie will be added to the HTTP request: Cookie: JSESSIONID abc123 + + Configure API client with HTTP basic authentication: + conf = petstore_api.Configuration( + username='the-user', + password='the-password', + ) + + Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme, + sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time + of the signature to 5 minutes after the signature has been created. + Note you can use the constants defined in the petstore_api.signing module, and you can + also specify arbitrary HTTP headers to be included in the HTTP signature, except for the + 'Authorization' header, which is used to carry the signature. + + One may be tempted to sign all headers by default, but in practice it rarely works. + This is beccause explicit proxies, transparent proxies, TLS termination endpoints or + load balancers may add/modify/remove headers. Include the HTTP headers that you know + are not going to be modified in transit. + + conf = petstore_api.Configuration( + signing_info = petstore_api.signing.HttpSigningConfiguration( + key_id = 'my-key-id', + private_key_path = 'rsa.pem', + signing_scheme = signing.SCHEME_HS2019, + signing_algorithm = signing.ALGORITHM_RSASSA_PSS, + signed_headers = [signing.HEADER_REQUEST_TARGET, + signing.HEADER_CREATED, + signing.HEADER_EXPIRES, + signing.HEADER_HOST, + signing.HEADER_DATE, + signing.HEADER_DIGEST, + 'Content-Type', + 'Content-Length', + 'User-Agent' + ], + signature_max_validity = datetime.timedelta(minutes=5) + ) + ) """ def __init__(self, host="http://petstore.swagger.io:80/v2", api_key=None, api_key_prefix=None, - username=None, password=None): + username=None, password=None, + signing_info=None): """Constructor """ self.host = host @@ -88,6 +129,11 @@ def __init__(self, host="http://petstore.swagger.io:80/v2", self.password = password """Password for HTTP basic authentication """ + if signing_info is not None: + signing_info.host = host + self.signing_info = signing_info + """The HTTP signing configuration + """ self.access_token = "" """access token for OAuth/Bearer """ @@ -304,6 +350,13 @@ def auth_settings(self): 'key': 'Authorization', 'value': self.get_basic_auth_token() } + if self.signing_info is not None: + auth['http_signature_test'] = { + 'type': 'http-signature', + 'in': 'header', + 'key': 'Authorization', + 'value': None # Signature headers are calculated for every HTTP request + } if self.access_token is not None: auth['petstore_auth'] = { 'type': 'oauth2', diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py index f99ea80ad637..b896f2ff0b68 100644 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -22,6 +22,8 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES.append("pem>=19.3.0") +REQUIRES.append("pycryptodome>=3.9.0") EXTRAS = {':python_version <= "2.7"': ['future']} setup( diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt index 06f7754d2044..f07d3f8ded26 100644 --- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -1,4 +1,5 @@ pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 -mock; python_version<="2.7" \ No newline at end of file +pycryptodome>=3.9.0 +mock; python_version<="2.7" diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 23022d60f3ea..06b46c85aff8 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -276,11 +276,11 @@ def test_valid_http_signature(self): mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' 'headers="\(request-target\) \(created\) host date digest content-type",' 'signature="[a-zA-Z0-9+/]+="', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) pet_api.add_pet(self.pet) @@ -307,11 +307,11 @@ def test_valid_http_signature_with_defaults(self): mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' 'headers="\(created\)",' 'signature="[a-zA-Z0-9+/]+="', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) pet_api.add_pet(self.pet) @@ -343,11 +343,11 @@ def test_valid_http_signature_rsassa_pkcs1v15(self): mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' 'headers="\(request-target\) \(created\)",' 'signature="[a-zA-Z0-9+/]+="', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) pet_api.add_pet(self.pet) @@ -379,11 +379,11 @@ def test_valid_http_signature_rsassa_pss(self): mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' 'headers="\(request-target\) \(created\)",' 'signature="[a-zA-Z0-9+/]+="', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) pet_api.add_pet(self.pet) @@ -414,11 +414,11 @@ def test_valid_http_signature_ec_p521(self): mock_pool.set_signing_config(signing_cfg) mock_pool.expect_request('POST', 'http://petstore.swagger.io/v2/pet', body=json.dumps(api_client.sanitize_for_serialization(self.pet)), - headers={'Content-Type': 'application/json', - 'Authorization': 'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' + headers={'Content-Type': r'application/json', + 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' 'headers="\(request-target\) \(created\)",' 'signature="[a-zA-Z0-9+/]+"', - 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) pet_api.add_pet(self.pet) From a14c50611555a8fc3903bd742e8197dfc5b927d9 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 22 Jan 2020 15:28:58 -0800 Subject: [PATCH 095/102] write HTTP signed headers in user-specified order. Fix PEP8 formatting issues --- .../python/python-experimental/api.mustache | 2 +- .../python-experimental/api_client.mustache | 3 - .../python-experimental/signing.mustache | 83 ++++++++++--------- .../petstore_api/api/pet_api.py | 8 +- .../petstore_api/api_client.py | 1 - .../tests/test_http_signature.py | 60 +++++++++----- 6 files changed, 89 insertions(+), 68 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache index 2182d7362d0e..8390a848d263 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache @@ -120,7 +120,7 @@ class {{classname}}(object): {{#-first}} 'auth': [ {{/-first}} - '{{name}}'{{#hasMore}}, {{/hasMore}} + '{{name}}'{{#hasMore}},{{/hasMore}} {{#-last}} ], {{/-last}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 2fe04b079e39..952089612037 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -15,9 +15,6 @@ import tornado.gen {{/tornado}} from {{packageName}} import rest -{{#hasHttpSignatureMethods}} -from {{packageName}} import signing -{{/hasHttpSignatureMethods}} from {{packageName}}.configuration import Configuration from {{packageName}}.exceptions import ApiValueError from {{packageName}}.model_utils import ( diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index f323d5285377..f649ea18034a 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -7,7 +7,7 @@ from Crypto.IO import PEM, PKCS8 from Crypto.Hash import SHA256, SHA512 from Crypto.PublicKey import RSA, ECC from Crypto.Signature import PKCS1_v1_5, pss, DSS -from datetime import datetime, timedelta +from datetime import datetime from email.utils import formatdate import json import os @@ -37,10 +37,11 @@ ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 } + class HttpSigningConfiguration(object): """The configuration parameters for the HTTP signature security scheme. The HTTP signature security scheme is used to sign HTTP requests with a private key - which is in possession of the API client. + which is in possession of the API client. An 'Authorization' header is calculated by creating a hash of select headers, and optionally the body of the HTTP request, then signing the hash value using a private key. The 'Authorization' header is added to outbound HTTP requests. @@ -110,7 +111,7 @@ class HttpSigningConfiguration(object): signed_headers = [HEADER_CREATED] if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: raise Exception( - "Signature max validity must be set when " \ + "Signature max validity must be set when " "'(expires)' signature parameter is specified") if len(signed_headers) != len(set(signed_headers)): raise Exception("Cannot have duplicates in the signed_headers parameter") @@ -128,7 +129,7 @@ class HttpSigningConfiguration(object): def get_http_signature_headers(self, resource_path, method, headers, body, query_params): """Create a cryptographic message signature for the HTTP request and add the signed headers. - + :param resource_path : A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method, e.g. GET, POST. :param headers: A dict containing the HTTP request headers. @@ -141,18 +142,18 @@ class HttpSigningConfiguration(object): if resource_path is None: raise Exception("Resource path must be set") - signed_headers_dict, request_headers_dict = self._get_signed_header_info( + signed_headers_list, request_headers_dict = self._get_signed_header_info( resource_path, method, headers, body, query_params) header_items = [ - "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] string_to_sign = "\n".join(header_items) digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) b64_signed_msg = self._sign_digest(digest) request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( - signed_headers_dict, b64_signed_msg) + signed_headers_list, b64_signed_msg) return request_headers_dict @@ -188,10 +189,10 @@ class HttpSigningConfiguration(object): elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: # Key is in PKCS8 format, which is capable of holding many different # types of private keys, not just EC keys. - (key_binary, pem_header, is_encrypted) = PEM.decode(pem_data, - self.private_key_passphrase) - (oid, privkey, params) = PKCS8.unwrap(key_binary, - passphrase=self.private_key_passphrase) + (key_binary, pem_header, is_encrypted) = \ + PEM.decode(pem_data, self.private_key_passphrase) + (oid, privkey, params) = \ + PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) if oid == '1.2.840.10045.2.1': self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) else: @@ -206,18 +207,19 @@ class HttpSigningConfiguration(object): elif isinstance(self.private_key, ECC.EccKey): supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS if supported_algs is not None and self.signing_algorithm not in supported_algs: - raise Exception("Signing algorithm {0} is " - "not compatible with private key".format(self.signing_algorithm)) + raise Exception( + "Signing algorithm {0} is not compatible with private key".format( + self.signing_algorithm)) def _get_unix_time(self, ts): """Converts and returns a datetime object to UNIX time, the number of seconds elapsed since January 1, 1970 UTC. """ - return (ts - datetime(1970,1,1)).total_seconds() + return (ts - datetime(1970, 1, 1)).total_seconds() def _get_signed_header_info(self, resource_path, method, headers, body, query_params): - """ - Build the HTTP headers (name, value) that need to be included in the HTTP signature scheme. + """Build the HTTP headers (name, value) that need to be included in + the HTTP signature scheme. :param resource_path : A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method, e.g. GET, POST. @@ -225,8 +227,10 @@ class HttpSigningConfiguration(object): :param body: The object (e.g. a dict) representing the HTTP request body. :param query_params: A string representing the HTTP request query parameters. :return: A tuple containing two dict objects: - The first dict contains the HTTP headers that are used to calculate the HTTP signature. - The second dict contains the HTTP headers that must be added to the outbound HTTP request. + The first dict contains the HTTP headers that are used to calculate + the HTTP signature. + The second dict contains the HTTP headers that must be added to + the outbound HTTP request. """ if body is None: @@ -252,7 +256,7 @@ class HttpSigningConfiguration(object): if self.signature_max_validity is not None: expires = self._get_unix_time(now + self.signature_max_validity) - signed_headers_dict = {} + signed_headers_list = [] request_headers_dict = {} for hdr_key in self.signed_headers: hdr_key = hdr_key.lower() @@ -278,21 +282,22 @@ class HttpSigningConfiguration(object): else: value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) if value is None: - raise Exception("Cannot sign HTTP request. " + raise Exception( + "Cannot sign HTTP request. " "Request does not contain the '{0}' header".format(hdr_key)) - signed_headers_dict[hdr_key] = value + signed_headers_list.append((hdr_key, value)) - return signed_headers_dict, request_headers_dict + return signed_headers_list, request_headers_dict def _get_message_digest(self, data): - """ - Calculates and returns a cryptographic digest of a specified HTTP request. + """Calculates and returns a cryptographic digest of a specified HTTP request. :param data: The string representation of the date to be hashed with a cryptographic hash. :return: A tuple of (digest, prefix). - The digest is a hashing object that contains the cryptographic digest of the HTTP request. - The prefix is a string that identifies the cryptographc hash. It is used to generate the - 'Digest' header as specified in RFC 3230. + The digest is a hashing object that contains the cryptographic digest of + the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used + to generate the 'Digest' header as specified in RFC 3230. """ if self.signing_scheme in {SCHEME_RSA_SHA512, SCHEME_HS2019}: digest = SHA512.new() @@ -306,8 +311,7 @@ class HttpSigningConfiguration(object): return digest, prefix def _sign_digest(self, digest): - """ - Signs a message digest with a private key specified in the signing_info. + """Signs a message digest with a private key specified in the signing_info. :param digest: A hashing object that contains the cryptographic digest of the HTTP request. :return: A base-64 string representing the cryptographic signature of the input digest. @@ -334,19 +338,22 @@ class HttpSigningConfiguration(object): return b64encode(signature) def _get_authorization_header(self, signed_headers, signed_msg): - """ - Calculates and returns the value of the 'Authorization' header when signing HTTP requests. - - :param signed_headers : A list of strings. Each value is the name of a HTTP header that + """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of tuples. Each value is the name of a HTTP header that must be included in the HTTP signature calculation. :param signed_msg: A base-64 encoded string representation of the signature. :return: The string value of the 'Authorization' header, representing the signature of the HTTP request. """ - - created_ts = signed_headers.get(HEADER_CREATED) - expires_ts = signed_headers.get(HEADER_EXPIRES) - lower_keys = [k.lower() for k in signed_headers] + created_ts = None + expires_ts = None + for k, v in signed_headers: + if k == HEADER_CREATED: + created_ts = v + elif k == HEADER_EXPIRES: + expires_ts = v + lower_keys = [k.lower() for k, v in signed_headers] headers_value = " ".join(lower_keys) auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( @@ -357,4 +364,6 @@ class HttpSigningConfiguration(object): auth_str = auth_str + "expires={0},".format(expires_ts) auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( headers_value, signed_msg.decode('ascii')) + + print("AUTH: {0}".format(auth_str)) return auth_str diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index ceec6252c76f..53f199f9a896 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -110,7 +110,7 @@ def __add_pet(self, pet_pet, **kwargs): # noqa: E501 settings={ 'response_type': None, 'auth': [ - 'http_signature_test', + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet', @@ -337,7 +337,7 @@ def __find_pets_by_status(self, status, **kwargs): # noqa: E501 settings={ 'response_type': ([pet.Pet],), 'auth': [ - 'http_signature_test', + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet/findByStatus', @@ -457,7 +457,7 @@ def __find_pets_by_tags(self, tags, **kwargs): # noqa: E501 settings={ 'response_type': ([pet.Pet],), 'auth': [ - 'http_signature_test', + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet/findByTags', @@ -680,7 +680,7 @@ def __update_pet(self, pet_pet, **kwargs): # noqa: E501 settings={ 'response_type': None, 'auth': [ - 'http_signature_test', + 'http_signature_test', 'petstore_auth' ], 'endpoint_path': '/pet', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py index cfe7438cb66c..c5d90d2a0601 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api_client.py @@ -20,7 +20,6 @@ from six.moves.urllib.parse import quote from petstore_api import rest -from petstore_api import signing from petstore_api.configuration import Configuration from petstore_api.exceptions import ApiValueError from petstore_api.model_utils import ( diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py index 06b46c85aff8..c6c7c5e9bc11 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_http_signature.py @@ -135,20 +135,20 @@ def _validate_authorization_header(self, request_target, actual_headers, authori m1 = r1.search(authorization_header) self._tc.assertIsNotNone(m1) headers = m1.group(1).split(' ') - signed_headers_dict = {} + signed_headers_list = [] for h in headers: if h == '(created)': - signed_headers_dict[h] = created + signed_headers_list.append((h, created)) elif h == '(request-target)': url = request_target[1] target_path = urlparse(url).path - signed_headers_dict[h] = "{0} {1}".format(request_target[0].lower(), target_path) + signed_headers_list.append((h, "{0} {1}".format(request_target[0].lower(), target_path))) else: value = next((v for k, v in actual_headers.items() if k.lower() == h), None) self._tc.assertIsNotNone(value) - signed_headers_dict[h] = value + signed_headers_list.append((h, value)) header_items = [ - "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_dict.items()] + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] string_to_sign = "\n".join(header_items) digest = None if self.signing_cfg.signing_scheme in {signing.SCHEME_RSA_SHA512, signing.SCHEME_HS2019}: @@ -278,8 +278,8 @@ def test_valid_http_signature(self): body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': r'application/json', 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - 'headers="\(request-target\) \(created\) host date digest content-type",' - 'signature="[a-zA-Z0-9+/]+="', + r'headers="\(request-target\) \(created\) host date digest content-type",' + r'signature="[a-zA-Z0-9+/]+="', 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) @@ -309,8 +309,8 @@ def test_valid_http_signature_with_defaults(self): body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': r'application/json', 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - 'headers="\(created\)",' - 'signature="[a-zA-Z0-9+/]+="', + r'headers="\(created\)",' + r'signature="[a-zA-Z0-9+/]+="', 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) @@ -345,8 +345,8 @@ def test_valid_http_signature_rsassa_pkcs1v15(self): body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': r'application/json', 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - 'headers="\(request-target\) \(created\)",' - 'signature="[a-zA-Z0-9+/]+="', + r'headers="\(request-target\) \(created\)",' + r'signature="[a-zA-Z0-9+/]+="', 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) @@ -381,8 +381,8 @@ def test_valid_http_signature_rsassa_pss(self): body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': r'application/json', 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - 'headers="\(request-target\) \(created\)",' - 'signature="[a-zA-Z0-9+/]+="', + r'headers="\(request-target\) \(created\)",' + r'signature="[a-zA-Z0-9+/]+="', 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) @@ -416,8 +416,8 @@ def test_valid_http_signature_ec_p521(self): body=json.dumps(api_client.sanitize_for_serialization(self.pet)), headers={'Content-Type': r'application/json', 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,' - 'headers="\(request-target\) \(created\)",' - 'signature="[a-zA-Z0-9+/]+"', + r'headers="\(request-target\) \(created\)",' + r'signature="[a-zA-Z0-9+/]+"', 'User-Agent': r'OpenAPI-Generator/1.0.0/python'}, preload_content=True, timeout=None) @@ -425,61 +425,77 @@ def test_valid_http_signature_ec_p521(self): def test_invalid_configuration(self): # Signing scheme must be valid. - with self.assertRaisesRegex(Exception, 'Unsupported security scheme'): + with self.assertRaises(Exception) as cm: signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme='foo', private_key_path=self.ec_p521_key_path ) + self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) # Signing scheme must be specified. - with self.assertRaisesRegex(Exception, 'Unsupported security scheme'): + with self.assertRaises(Exception) as cm: signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", private_key_path=self.ec_p521_key_path, signing_scheme=None ) + self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) # Private key passphrase is missing but key is encrypted. - with self.assertRaisesRegex(Exception, 'Not a valid clear PKCS#8 structure'): + with self.assertRaises(Exception) as cm: signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path=self.ec_p521_key_path, ) + self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) # File containing private key must exist. - with self.assertRaisesRegex(Exception, 'Private key file does not exist'): + with self.assertRaises(Exception) as cm: signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path='foobar', ) + self.assertTrue(re.match('Private key file does not exist', str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) # The max validity must be a positive value. - with self.assertRaisesRegex(Exception, 'The signature max validity must be a positive value'): + with self.assertRaises(Exception) as cm: signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path=self.ec_p521_key_path, signature_max_validity=timedelta(hours=-1) ) + self.assertTrue(re.match('The signature max validity must be a positive value', + str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) # Cannot include the 'Authorization' header. - with self.assertRaisesRegex(Exception, "'Authorization' header cannot be included"): + with self.assertRaises(Exception) as cm: signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path=self.ec_p521_key_path, signed_headers=['Authorization'] ) + self.assertTrue(re.match("'Authorization' header cannot be included", str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) # Cannot specify duplicate headers. - with self.assertRaisesRegex(Exception, 'duplicate'): + with self.assertRaises(Exception) as cm: signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path=self.ec_p521_key_path, signed_headers=['Host', 'Date', 'Host'] ) + self.assertTrue(re.match('Cannot have duplicates in the signed_headers parameter', + str(cm.exception)), + 'Exception message: {0}'.format(str(cm.exception))) From a2b0c8420cfe0748ba6ad6469f590454ecf441e7 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 22 Jan 2020 15:36:56 -0800 Subject: [PATCH 096/102] write HTTP signed headers in user-specified order. Fix PEP8 formatting issues --- .../petstore_api/signing.py | 377 ++++++++++++++++++ 1 file changed, 377 insertions(+) create mode 100644 samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py new file mode 100644 index 000000000000..8c731da33bb1 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -0,0 +1,377 @@ +# coding: utf-8 +""" + 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: \" \\ # noqa: E501 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +from base64 import b64encode +from Crypto.IO import PEM, PKCS8 +from Crypto.Hash import SHA256, SHA512 +from Crypto.PublicKey import RSA, ECC +from Crypto.Signature import PKCS1_v1_5, pss, DSS +from datetime import datetime +from email.utils import formatdate +import json +import os +import re +from six.moves.urllib.parse import urlencode, urlparse +from time import mktime + +HEADER_REQUEST_TARGET = '(request-target)' +HEADER_CREATED = '(created)' +HEADER_EXPIRES = '(expires)' +HEADER_HOST = 'Host' +HEADER_DATE = 'Date' +HEADER_DIGEST = 'Digest' +HEADER_AUTHORIZATION = 'Authorization' + +SCHEME_HS2019 = 'hs2019' +SCHEME_RSA_SHA256 = 'rsa-sha256' +SCHEME_RSA_SHA512 = 'rsa-sha512' + +ALGORITHM_RSASSA_PSS = 'RSASSA-PSS' +ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5' + +ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3' +ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979' +ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = { + ALGORITHM_ECDSA_MODE_FIPS_186_3, + ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 +} + + +class HttpSigningConfiguration(object): + """The configuration parameters for the HTTP signature security scheme. + The HTTP signature security scheme is used to sign HTTP requests with a private key + which is in possession of the API client. + An 'Authorization' header is calculated by creating a hash of select headers, + and optionally the body of the HTTP request, then signing the hash value using + a private key. The 'Authorization' header is added to outbound HTTP requests. + + NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param key_id: A string value specifying the identifier of the cryptographic key, + when signing HTTP requests. + :param signing_scheme: A string value specifying the signature scheme, when + signing HTTP requests. + Supported value are hs2019, rsa-sha256, rsa-sha512. + Avoid using rsa-sha256, rsa-sha512 as they are deprecated. These values are + available for server-side applications that only support the older + HTTP signature algorithms. + :param private_key_path: A string value specifying the path of the file containing + a private key. The private key is used to sign HTTP requests. + :param private_key_passphrase: A string value specifying the passphrase to decrypt + the private key. + :param signed_headers: A list of strings. Each value is the name of a HTTP header + that must be included in the HTTP signature calculation. + The two special signature headers '(request-target)' and '(created)' SHOULD be + included in SignedHeaders. + The '(created)' header expresses when the signature was created. + The '(request-target)' header is a concatenation of the lowercased :method, an + ASCII space, and the :path pseudo-headers. + When signed_headers is not specified, the client defaults to a single value, + '(created)', in the list of HTTP headers. + When SignedHeaders contains the 'Digest' value, the client performs the + following operations: + 1. Calculate a digest of request body, as specified in RFC3230, section 4.3.2. + 2. Set the 'Digest' header in the request body. + 3. Include the 'Digest' header and value in the HTTP signature. + :param signing_algorithm: A string value specifying the signature algorithm, when + signing HTTP requests. + Supported values are: + 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5. + 2. For ECDSA keys: fips-186-3, deterministic-rfc6979. + The default value is inferred from the private key. + The default value for RSA keys is RSASSA-PSS. + The default value for ECDSA keys is fips-186-3. + :param signature_max_validity: The signature max validity, expressed as + a datetime.timedelta value. It must be a positive value. + """ + def __init__(self, key_id, signing_scheme, private_key_path, + private_key_passphrase=None, + signed_headers=None, + signing_algorithm=None, + signature_max_validity=None): + self.key_id = key_id + if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: + raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) + self.signing_scheme = signing_scheme + if not os.path.exists(private_key_path): + raise Exception("Private key file does not exist") + self.private_key_path = private_key_path + self.private_key_passphrase = private_key_passphrase + self.signing_algorithm = signing_algorithm + if signature_max_validity is not None and signature_max_validity.total_seconds() < 0: + raise Exception("The signature max validity must be a positive value") + self.signature_max_validity = signature_max_validity + # If the user has not provided any signed_headers, the default must be set to '(created)', + # as specified in the 'HTTP signature' standard. + if signed_headers is None or len(signed_headers) == 0: + signed_headers = [HEADER_CREATED] + if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers: + raise Exception( + "Signature max validity must be set when " + "'(expires)' signature parameter is specified") + if len(signed_headers) != len(set(signed_headers)): + raise Exception("Cannot have duplicates in the signed_headers parameter") + if HEADER_AUTHORIZATION in signed_headers: + raise Exception("'Authorization' header cannot be included in signed headers") + self.signed_headers = signed_headers + self.private_key = None + """The private key used to sign HTTP requests. + Initialized when the PEM-encoded private key is loaded from a file. + """ + self.host = None + """The host name, optionally followed by a colon and TCP port number. + """ + self._load_private_key() + + def get_http_signature_headers(self, resource_path, method, headers, body, query_params): + """Create a cryptographic message signature for the HTTP request and add the signed headers. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A dict of HTTP headers that must be added to the outbound HTTP request. + """ + if method is None: + raise Exception("HTTP method must be set") + if resource_path is None: + raise Exception("Resource path must be set") + + signed_headers_list, request_headers_dict = self._get_signed_header_info( + resource_path, method, headers, body, query_params) + + header_items = [ + "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list] + string_to_sign = "\n".join(header_items) + + digest, digest_prefix = self._get_message_digest(string_to_sign.encode()) + b64_signed_msg = self._sign_digest(digest) + + request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header( + signed_headers_list, b64_signed_msg) + + return request_headers_dict + + def get_public_key(self): + """Returns the public key object associated with the private key. + """ + pubkey = None + if isinstance(self.private_key, RSA.RsaKey): + pubkey = self.private_key.publickey() + elif isinstance(self.private_key, ECC.EccKey): + pubkey = self.private_key.public_key() + return pubkey + + def _load_private_key(self): + """Load the private key used to sign HTTP requests. + The private key is used to sign HTTP requests as defined in + https://datatracker.ietf.org/doc/draft-cavage-http-signatures/. + """ + if self.private_key is not None: + return + with open(self.private_key_path, 'r') as f: + pem_data = f.read() + # Verify PEM Pre-Encapsulation Boundary + r = re.compile(r"\s*-----BEGIN (.*)-----\s+") + m = r.match(pem_data) + if not m: + raise ValueError("Not a valid PEM pre boundary") + pem_header = m.group(1) + if pem_header == 'RSA PRIVATE KEY': + self.private_key = RSA.importKey(pem_data, self.private_key_passphrase) + elif pem_header == 'EC PRIVATE KEY': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}: + # Key is in PKCS8 format, which is capable of holding many different + # types of private keys, not just EC keys. + (key_binary, pem_header, is_encrypted) = \ + PEM.decode(pem_data, self.private_key_passphrase) + (oid, privkey, params) = \ + PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase) + if oid == '1.2.840.10045.2.1': + self.private_key = ECC.import_key(pem_data, self.private_key_passphrase) + else: + raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid)) + else: + raise Exception("Unsupported key: {0}".format(pem_header)) + # Validate the specified signature algorithm is compatible with the private key. + if self.signing_algorithm is not None: + supported_algs = None + if isinstance(self.private_key, RSA.RsaKey): + supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15} + elif isinstance(self.private_key, ECC.EccKey): + supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS + if supported_algs is not None and self.signing_algorithm not in supported_algs: + raise Exception( + "Signing algorithm {0} is not compatible with private key".format( + self.signing_algorithm)) + + def _get_unix_time(self, ts): + """Converts and returns a datetime object to UNIX time, the number of seconds + elapsed since January 1, 1970 UTC. + """ + return (ts - datetime(1970, 1, 1)).total_seconds() + + def _get_signed_header_info(self, resource_path, method, headers, body, query_params): + """Build the HTTP headers (name, value) that need to be included in + the HTTP signature scheme. + + :param resource_path : A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method, e.g. GET, POST. + :param headers: A dict containing the HTTP request headers. + :param body: The object (e.g. a dict) representing the HTTP request body. + :param query_params: A string representing the HTTP request query parameters. + :return: A tuple containing two dict objects: + The first dict contains the HTTP headers that are used to calculate + the HTTP signature. + The second dict contains the HTTP headers that must be added to + the outbound HTTP request. + """ + + if body is None: + body = '' + else: + body = json.dumps(body) + + # Build the '(request-target)' HTTP signature parameter. + target_host = urlparse(self.host).netloc + target_path = urlparse(self.host).path + request_target = method.lower() + " " + target_path + resource_path + if query_params: + raw_query = urlencode(query_params).replace('+', '%20') + request_target += "?" + raw_query + + # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. + now = datetime.now() + stamp = mktime(now.timetuple()) + cdate = formatdate(timeval=stamp, localtime=False, usegmt=True) + # The '(created)' value MUST be a Unix timestamp integer value. + # Subsecond precision is not supported. + created = int(self._get_unix_time(now)) + if self.signature_max_validity is not None: + expires = self._get_unix_time(now + self.signature_max_validity) + + signed_headers_list = [] + request_headers_dict = {} + for hdr_key in self.signed_headers: + hdr_key = hdr_key.lower() + if hdr_key == HEADER_REQUEST_TARGET: + value = request_target + elif hdr_key == HEADER_CREATED: + value = '{0}'.format(created) + elif hdr_key == HEADER_EXPIRES: + value = '{0}'.format(expires) + elif hdr_key == HEADER_DATE.lower(): + value = cdate + request_headers_dict[HEADER_DATE] = '{0}'.format(cdate) + elif hdr_key == HEADER_DIGEST.lower(): + request_body = body.encode() + body_digest, digest_prefix = self._get_message_digest(request_body) + b64_body_digest = b64encode(body_digest.digest()) + value = digest_prefix + b64_body_digest.decode('ascii') + request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format( + digest_prefix, b64_body_digest.decode('ascii')) + elif hdr_key == HEADER_HOST.lower(): + value = target_host + request_headers_dict[HEADER_HOST] = '{0}'.format(target_host) + else: + value = next((v for k, v in headers.items() if k.lower() == hdr_key), None) + if value is None: + raise Exception( + "Cannot sign HTTP request. " + "Request does not contain the '{0}' header".format(hdr_key)) + signed_headers_list.append((hdr_key, value)) + + return signed_headers_list, request_headers_dict + + def _get_message_digest(self, data): + """Calculates and returns a cryptographic digest of a specified HTTP request. + + :param data: The string representation of the date to be hashed with a cryptographic hash. + :return: A tuple of (digest, prefix). + The digest is a hashing object that contains the cryptographic digest of + the HTTP request. + The prefix is a string that identifies the cryptographc hash. It is used + to generate the 'Digest' header as specified in RFC 3230. + """ + if self.signing_scheme in {SCHEME_RSA_SHA512, SCHEME_HS2019}: + digest = SHA512.new() + prefix = 'SHA-512=' + elif self.signing_scheme == SCHEME_RSA_SHA256: + digest = SHA256.new() + prefix = 'SHA-256=' + else: + raise Exception("Unsupported signing algorithm: {0}".format(self.signing_scheme)) + digest.update(data) + return digest, prefix + + def _sign_digest(self, digest): + """Signs a message digest with a private key specified in the signing_info. + + :param digest: A hashing object that contains the cryptographic digest of the HTTP request. + :return: A base-64 string representing the cryptographic signature of the input digest. + """ + sig_alg = self.signing_algorithm + if isinstance(self.private_key, RSA.RsaKey): + if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS: + # RSASSA-PSS in Section 8.1 of RFC8017. + signature = pss.new(self.private_key).sign(digest) + elif sig_alg == ALGORITHM_RSASSA_PKCS1v15: + # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017. + signature = PKCS1_v1_5.new(self.private_key).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + elif isinstance(self.private_key, ECC.EccKey): + if sig_alg is None: + sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3 + if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS: + signature = DSS.new(self.private_key, sig_alg).sign(digest) + else: + raise Exception("Unsupported signature algorithm: {0}".format(sig_alg)) + else: + raise Exception("Unsupported private key: {0}".format(type(self.private_key))) + return b64encode(signature) + + def _get_authorization_header(self, signed_headers, signed_msg): + """Calculates and returns the value of the 'Authorization' header when signing HTTP requests. + + :param signed_headers : A list of tuples. Each value is the name of a HTTP header that + must be included in the HTTP signature calculation. + :param signed_msg: A base-64 encoded string representation of the signature. + :return: The string value of the 'Authorization' header, representing the signature + of the HTTP request. + """ + created_ts = None + expires_ts = None + for k, v in signed_headers: + if k == HEADER_CREATED: + created_ts = v + elif k == HEADER_EXPIRES: + expires_ts = v + lower_keys = [k.lower() for k, v in signed_headers] + headers_value = " ".join(lower_keys) + + auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format( + self.key_id, self.signing_scheme) + if created_ts is not None: + auth_str = auth_str + "created={0},".format(created_ts) + if expires_ts is not None: + auth_str = auth_str + "expires={0},".format(expires_ts) + auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format( + headers_value, signed_msg.decode('ascii')) + + print("AUTH: {0}".format(auth_str)) + return auth_str From 2137cc177df99fce756b365bbbbbd8a259c16f9a Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 22 Jan 2020 19:32:57 -0800 Subject: [PATCH 097/102] http signature unit tests --- .../main/resources/python/python-experimental/signing.mustache | 2 +- .../python/python-experimental/test-requirements.mustache | 2 +- .../client/petstore/python-experimental/petstore_api/signing.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index f649ea18034a..837e59173d49 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -20,7 +20,7 @@ HEADER_CREATED = '(created)' HEADER_EXPIRES = '(expires)' HEADER_HOST = 'Host' HEADER_DATE = 'Date' -HEADER_DIGEST = 'Digest' +HEADER_DIGEST = 'Digest' # RFC 3230 HEADER_AUTHORIZATION = 'Authorization' SCHEME_HS2019 = 'hs2019' diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache index 1c3a9569e941..ebdee3392e40 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/test-requirements.mustache @@ -13,4 +13,4 @@ pytest-randomly==1.2.3 # needed for python 2.7+3.4 {{#hasHttpSignatureMethods}} pycryptodome>=3.9.0 {{/hasHttpSignatureMethods}} -mock; python_version<="2.7" +mock; python_version<="2.7" \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py index 8c731da33bb1..87e8327c6ed2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -28,7 +28,7 @@ HEADER_EXPIRES = '(expires)' HEADER_HOST = 'Host' HEADER_DATE = 'Date' -HEADER_DIGEST = 'Digest' +HEADER_DIGEST = 'Digest' # RFC 3230 HEADER_AUTHORIZATION = 'Authorization' SCHEME_HS2019 = 'hs2019' From e532a67039ef2946e1c7d30d348a5495cd472447 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Wed, 22 Jan 2020 20:36:24 -0800 Subject: [PATCH 098/102] Fix PEP8 format issue --- .../main/resources/python/python-experimental/signing.mustache | 2 +- .../client/petstore/python-experimental/petstore_api/signing.py | 2 +- .../client/petstore/python-experimental/test-requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index 837e59173d49..ea069ab75621 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -20,7 +20,7 @@ HEADER_CREATED = '(created)' HEADER_EXPIRES = '(expires)' HEADER_HOST = 'Host' HEADER_DATE = 'Date' -HEADER_DIGEST = 'Digest' # RFC 3230 +HEADER_DIGEST = 'Digest' # RFC 3230, include digest of the HTTP request body. HEADER_AUTHORIZATION = 'Authorization' SCHEME_HS2019 = 'hs2019' diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py index 87e8327c6ed2..9f42208eff57 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -28,7 +28,7 @@ HEADER_EXPIRES = '(expires)' HEADER_HOST = 'Host' HEADER_DATE = 'Date' -HEADER_DIGEST = 'Digest' # RFC 3230 +HEADER_DIGEST = 'Digest' # RFC 3230, include digest of the HTTP request body. HEADER_AUTHORIZATION = 'Authorization' SCHEME_HS2019 = 'hs2019' diff --git a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt index f07d3f8ded26..bf6f7a19972c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test-requirements.txt +++ b/samples/openapi3/client/petstore/python-experimental/test-requirements.txt @@ -2,4 +2,4 @@ pytest~=4.6.7 # needed for python 2.7+3.4 pytest-cov>=2.8.1 pytest-randomly==1.2.3 # needed for python 2.7+3.4 pycryptodome>=3.9.0 -mock; python_version<="2.7" +mock; python_version<="2.7" \ No newline at end of file From 39a6d014972ecd6b5448ebf8cc8cc9cdaa027cbd Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 23 Jan 2020 09:57:54 -0800 Subject: [PATCH 099/102] spread out each requirement to a separate line --- .../python/python-experimental/setup.mustache | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache index 9fab9e020b0d..2fe84efcee06 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/setup.mustache @@ -16,17 +16,22 @@ VERSION = "{{packageVersion}}" # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES = [ + "urllib3 >= 1.15", + "six >= 1.10", + "certifi", + "python-dateutil", {{#asyncio}} -REQUIRES.append("aiohttp >= 3.0.0") + "aiohttp >= 3.0.0", {{/asyncio}} {{#tornado}} -REQUIRES.append("tornado>=4.2,<5") + "tornado>=4.2,<5", {{/tornado}} {{#hasHttpSignatureMethods}} -REQUIRES.append("pem>=19.3.0") -REQUIRES.append("pycryptodome>=3.9.0") + "pem>=19.3.0", + "pycryptodome>=3.9.0", {{/hasHttpSignatureMethods}} +] EXTRAS = {':python_version <= "2.7"': ['future']} setup( From 15a5c09d6eb6575b99542c96dd2809d21cfe2950 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 23 Jan 2020 12:43:29 -0800 Subject: [PATCH 100/102] run samples scripts --- samples/client/petstore/python-experimental/setup.py | 7 ++++++- .../client/petstore/python-experimental/setup.py | 11 ++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/python-experimental/setup.py b/samples/client/petstore/python-experimental/setup.py index f99ea80ad637..7fef185a1a43 100644 --- a/samples/client/petstore/python-experimental/setup.py +++ b/samples/client/petstore/python-experimental/setup.py @@ -21,7 +21,12 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +REQUIRES = [ + "urllib3 >= 1.15", + "six >= 1.10", + "certifi", + "python-dateutil", +] EXTRAS = {':python_version <= "2.7"': ['future']} setup( diff --git a/samples/openapi3/client/petstore/python-experimental/setup.py b/samples/openapi3/client/petstore/python-experimental/setup.py index b896f2ff0b68..47c8b2787925 100644 --- a/samples/openapi3/client/petstore/python-experimental/setup.py +++ b/samples/openapi3/client/petstore/python-experimental/setup.py @@ -21,9 +21,14 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] -REQUIRES.append("pem>=19.3.0") -REQUIRES.append("pycryptodome>=3.9.0") +REQUIRES = [ + "urllib3 >= 1.15", + "six >= 1.10", + "certifi", + "python-dateutil", + "pem>=19.3.0", + "pycryptodome>=3.9.0", +] EXTRAS = {':python_version <= "2.7"': ['future']} setup( From 7184320d07c9cdb1d3810c1b284256f4ad7d66a6 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Thu, 23 Jan 2020 21:15:36 -0800 Subject: [PATCH 101/102] run sample scripts --- .../client/petstore/python-experimental/docs/PetApi.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 19099269da72..2a09dc5f86b2 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -22,7 +22,6 @@ Add a new pet to the store ### Example -* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function @@ -170,7 +169,6 @@ Multiple status values can be provided with comma separated strings ### Example -* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function @@ -253,7 +251,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example -* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function @@ -398,7 +395,6 @@ Update an existing pet ### Example -* Basic Authentication (http_signature_test): * OAuth Authentication (petstore_auth): ```python from __future__ import print_function From 4db1b218edb5704d738ee3659ee63c1d439eb49e Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sun, 26 Jan 2020 10:30:28 -0800 Subject: [PATCH 102/102] remove encoding of '+' character --- .../main/resources/python/python-experimental/signing.mustache | 3 +-- .../petstore/python-experimental/petstore_api/signing.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache index ea069ab75621..d191bbf48529 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/signing.mustache @@ -243,8 +243,7 @@ class HttpSigningConfiguration(object): target_path = urlparse(self.host).path request_target = method.lower() + " " + target_path + resource_path if query_params: - raw_query = urlencode(query_params).replace('+', '%20') - request_target += "?" + raw_query + request_target += "?" + urlencode(query_params) # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. now = datetime.now() diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py index 9f42208eff57..da45fdf4b22a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/signing.py @@ -251,8 +251,7 @@ def _get_signed_header_info(self, resource_path, method, headers, body, query_pa target_path = urlparse(self.host).path request_target = method.lower() + " " + target_path + resource_path if query_params: - raw_query = urlencode(query_params).replace('+', '%20') - request_target += "?" + raw_query + request_target += "?" + urlencode(query_params) # Get current time and generate RFC 1123 (HTTP/1.1) date/time string. now = datetime.now()